Skip to content

Commit

Permalink
Merge pull request #156 from lequal/v3.1.0-dev
Browse files Browse the repository at this point in the history
v3.1.0
  • Loading branch information
Omar WALDMANN authored Sep 14, 2018
2 parents 61c3739 + cc8b6ef commit c2cf78a
Show file tree
Hide file tree
Showing 185 changed files with 10,535 additions and 1,474 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ script :
- mvn install -DskipTests
- mvn verify
sudo: false
addons:
sonarcloud:
organization: "lequal"
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,42 @@ i-Code CNES is a static code analysis tool to help developers write code complia

All the informations on CNES standards coverage, and rules availabilities and limitations can be read in the [documentation](https://github.com/lequal/i-CodeCNES/tree/master/documentation).

Release 3.1.0
=============
## New features
* New command line #133
* New parsing error handling, a violation named "Parser error" is added instead of suspend the analysis. #154
* New rules (Shell)
* COM.DATA.Initialisation ( fix #113 )
* COM.DATA.Invariant ( fix #114 )
* COM.FLOW.FilePath ( fix #115 )
* COM.FLOW.Recursion ( fix #116 )
* COM.INST.BoolNegation ( fix #117 )
* COM.NAME.Homonymy ( fix #118 )
* COM.PRES.Indent ( fix #119 )
* COM.PRES.LengthLine ( fix #120 )
* SH.FLOW.CheckCodeReturn ( fix #121 )
* SH.Ref.Export ( fix #122 #52 #138 #137)
* SH.SYNC.Signals #123
* New metrics
* SH.MET.LineOfComment
* F77.MET.LineOfComment
* F90.MET.LineOfComment

## Fixes
* Shell
* All checkers :
* Function correction on FUNCSTART and FNAME #138 #137 #150
* COM.FLOW.CaseSwitch :
* Case handling fixed #135
* Function localization fixed #52
* COM.DATA.LoopCondition
* Function localization fixed #52
* COM.DESIGN.ActiveWait
* Function localization fixed #52
* COM.FLOW.Abort
* Function localization fixed #52

Release 3.0.1
=============
* Fix of Eclipse's plug-in performances #101
Expand Down
Binary file removed documentation/i-Code CNES - Manuel Utilisateur.pdf
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.analyzer/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: i-Code CNES Analyzer
Bundle-SymbolicName: fr.cnes.analysis.tools.analyzer;singleton:=true
Bundle-Version: 3.0.1.qualifier
Bundle-Version: 3.1.0.qualifier
Bundle-Activator: fr.cnes.analysis.tools.analyzer.Activator
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime
Expand Down
18 changes: 18 additions & 0 deletions fr.cnes.analysis.tools.analyzer/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,23 @@
<plugin>
<extension-point id="languages" name="languages" schema="schema/languages.exsd"/>
<extension-point id="checks" name="checks" schema="schema/checks.exsd"/>
<extension
id="id1"
name="name"
point="fr.cnes.analysis.tools.analyzer.checks">
<check
class="fr.cnes.analysis.tools.analyzer.datas.ParsingError"
id="fr.cnes.analysis.tools.analyzer.parsingError"
languageId="fr.cnes.analysis.tools.analyzer.parsingError"
name="Parsing Error">
</check>
</extension>
<extension
point="fr.cnes.analysis.tools.analyzer.languages">
<language
id="fr.cnes.analysis.tools.analyzer.parsingError"
name="Parsing Error">
</language>
</extension>

</plugin>
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.analyzer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>fr.cnes.icode.parent</artifactId>
<version>3.0.1-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.analysis.tools.analyzer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import fr.cnes.analysis.tools.analyzer.datas.AbstractChecker;
import fr.cnes.analysis.tools.analyzer.datas.CheckResult;
import fr.cnes.analysis.tools.analyzer.datas.ParsingError;
import fr.cnes.analysis.tools.analyzer.exception.JFlexException;
import fr.cnes.analysis.tools.analyzer.logger.ICodeLogger;

Expand Down Expand Up @@ -62,7 +63,17 @@ public List<CheckResult> call() throws IOException, JFlexException {
ICodeLogger.entering(CLASS, method);
final List<CheckResult> results = new ArrayList<>();
rule.setInputFile(file);
results.addAll(rule.run());
try {
results.addAll(rule.run());
} catch (JFlexException exception) {
ICodeLogger.error(exception.getFileName(), exception.getRuleName(), exception.getMessage());
CheckResult result = new CheckResult(ParsingError.PARSING_ERROR_NAME,ParsingError.PARSING_ERROR_ID, ParsingError.PARSING_ERROR_LANGUAGE);
result.setLine(Integer.valueOf(exception.getLine()));
result.setLocation(exception.getRuleName() +"[l"+exception.getLine()+":c"+exception.getColumn()+"]");
result.setMessage(exception.getErrorMessage());
result.setFile(file);
results.add(result);
}
ICodeLogger.exiting(CLASS, method, results);
return results;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package fr.cnes.analysis.tools.analyzer.datas;

import java.io.IOException;
import java.util.List;

/**
* This rule is intended to add record parsing exceptions.
*
*/
public class ParsingError extends AbstractChecker {

public final static String PARSING_ERROR_ID = "fr.cnes.analysis.tools.analyzer.parsingError";
public final static String PARSING_ERROR_LANGUAGE = "fr.cnes.analysis.tools.analyzer.parsingError";
public final static String PARSING_ERROR_NAME = "Parsing error";

public ParsingError() {
}


@Override
public List<CheckResult> run() throws IOException {
return getCheckResults();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ private static String errorMessage(String pRuleName, String pFileName, String pM
+ pMessage + BLANK + "CheckerId: " + pRuleName + BLANK + "File: "
+ pFileName + BLANK + "Line:" + pLine + BLANK + "Column:" + pColumn + BLANK

+ "Last word scanned : [" + pLastScan + "] [" + toDecimalCode(pLastScan)
+ "Last word scanned: [" + pLastScan + "] [" + toDecimalCode(pLastScan)
+ "]" + BLANK
+ "Please report this issue on : https://github.com/dupuisa/i-CodeCNES/issues/";
+ "Please report this issue on : https://github.com/lequal/i-CodeCNES/issues/";
return message;
}

Expand Down
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.export.csv/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: i-Code CNES CSV Export
Bundle-SymbolicName: fr.cnes.analysis.tools.export.csv;singleton:=true
Bundle-Version: 3.0.1.qualifier
Bundle-Version: 3.1.0.qualifier
Bundle-Activator: fr.cnes.analysis.tools.export.csv.Activator
Bundle-Vendor: CNES
Require-Bundle: org.eclipse.core.runtime,
Expand Down
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.export.csv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>fr.cnes.icode.parent</artifactId>
<version>3.0.1-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.analysis.tools.export.csv</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.export.xml/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: i-Code CNES XML Export
Bundle-SymbolicName: fr.cnes.analysis.tools.export.xml;singleton:=true
Bundle-Version: 3.0.1.qualifier
Bundle-Version: 3.1.0.qualifier
Bundle-Activator: fr.cnes.analysis.tools.export.xml.Activator
Bundle-Vendor: CNES
Require-Bundle: fr.cnes.analysis.tools.analyzer;bundle-version="2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.export.xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>fr.cnes.icode.parent</artifactId>
<version>3.0.1-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.analysis.tools.export.xml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.export/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: i-Code CNES Export
Bundle-SymbolicName: fr.cnes.analysis.tools.export;singleton:=true
Bundle-Version: 3.0.1.qualifier
Bundle-Version: 3.1.0.qualifier
Bundle-Vendor: CNES
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: fr.cnes.analysis.tools.analyzer,
Expand Down
2 changes: 1 addition & 1 deletion fr.cnes.analysis.tools.export/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>fr.cnes.icode.parent</artifactId>
<version>3.0.1-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.analysis.tools.export</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,24 @@ public class ExportService implements IExportService {
public void export(List<CheckResult> checkResults, File outputFile,
Map<String, String> parameters) throws NoContributorMatchingException,
NoExtensionIndicatedException, IOException, CoreException {
export(checkResults, outputFile, parameters,
ExportUtils.getExtensionFromFilePath(outputFile.getAbsolutePath()));
}

/*
* (non-Javadoc)
*
* @see fr.cnes.analysis.tools.export.IExportService#export(java.util.List,
* java.io.File, java.util.Map, java.lang.String)
*/
@Override
public void export(List<CheckResult> pCheckResults, File pOutputFile,
Map<String, String> pParameters, String pFormat) throws NoContributorMatchingException,
NoExtensionIndicatedException, IOException, CoreException {
final String method = "export";
ICodeLogger.entering(CLASS, method);
final IExporter exporter = getExportClass(
ExportUtils.getExtensionFromFilePath(outputFile.getAbsolutePath()));
exporter.export(checkResults, outputFile, parameters);
final IExporter exporter = getExportClass(pFormat);
exporter.export(pCheckResults, pOutputFile, pParameters);
ICodeLogger.exiting(CLASS, method);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,32 @@ public boolean hasParameters(String formatExtension)
*/
public Map<String, String> getParameters(String formatExtension)
throws NoContributorMatchingException, CoreException;

/**
* This function export each {@link CheckResult} of {@code checkResults}
* parameter into the {@link File} parameter.
*
* @param pCheckResults
* to export.
* @param pOutputFile
* to use for the export.
* @param pParameters
* parameter required by the export plugin.
* @param pFormat
* define the format of the results file.
* @throws NoContributorMatchingException
* when a format can not be handled by the @link
* {@link ExportService} service.
* @throws NoExtensionIndicatedException
* when the {@code outputFile} has no extension indicated.
* @throws IOException
* when the export failed due to a {@link java.io.File}
* exception.
* @throws CoreException
* when failing to create executable from contributor of
* {@link #EXPORT_EXTENSIONPOINT_ID}'s attribute
* {@link #EXPORT_EXTENSIONPOINT_ATTRIBUTE_EXPORTCLASS}.
*/
void export(List<CheckResult> pCheckResults, File pOutputFile, Map<String, String> pParameters, String pFormat)
throws NoContributorMatchingException, NoExtensionIndicatedException, IOException, CoreException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: i-Code CNES F77 Metrics
Bundle-SymbolicName: fr.cnes.analysis.tools.fortran77.metrics;singleton:=true
Bundle-Version: 3.0.1.qualifier
Bundle-Version: 3.1.0.qualifier
Bundle-Activator: fr.cnes.analysis.tools.fortran77.metrics.Activator
Require-Bundle: org.eclipse.core.runtime,
fr.cnes.analysis.tools.analyzer;bundle-version="2.0.0"
Expand Down
Loading

0 comments on commit c2cf78a

Please sign in to comment.