cnescatlab / i-codecnes Goto Github PK
View Code? Open in Web Editor NEWi-Code CNES is a static code analysis tool to help developpers write code compliant with CNES coding rules.
License: Eclipse Public License 1.0
i-Code CNES is a static code analysis tool to help developpers write code compliant with CNES coding rules.
License: Eclipse Public License 1.0
In some of the lex files, array are being used without verifying the size allocated to it. This might cause index out of bound errors.
Usage of Integer.parseInt(String) is not checked and throws exceptions of java.lang.numberformatException when running an analysis on some files.
Two jflex projects can be replaced by one dependency in the pom.xml
During build we get this message :
[WARNING] The following locally built units have been used to resolve project dependencies:
This is due to the usage of static versions in MANIFEST.MF and pom.xml. Instead of using 2.0.0 we should use 2.0.0.qualifier in Manifest and 2.0.0-SNAPSHOT in pom files
The following extension point is unused : fr.cnes.analysis.tools.menu.exd
To be removed.
The tooltip should be informative instead of showing the identifier of the handler.
There are no more notification indicating that the analysis is running when it is launched.
The IExport interface is :
public void export(List checkResults, File outputFile) throws IOException
It should define additional constants like : AUTHOR, DATE, EXPORT_NAME, etc... to be used in the export implementations.
An additional optional parameter map should be added as an additional parameter
public void export(List checkResults, File outputFile, Map<String, String> param)
Currently i-Code UI plugin is responsible of the analysis results export, the export code is included the ViolationsView
and MetricsView
for each formats available and the user must use dedicated Wizards
hardcoded to run an export.
This design causes difficulties to add any new export format into i-Code.
We would like to use a dedicated and externalized export plugin to export lists of Violation
and FileValue
objects in some different formats plugged to the export plugin. It implies to also externalize the XML and CSV exports into two dedicated plugins.
Also, we would like also the code to be evolutionary enough to prepare i-Code import feature and include it in the modifications.
This imply both to manage :
Violation
and FileValue
classes exported in the future dedicated plugins might be merged in a common class.
In most of the Shell analyzers, variables are defined by regular expressions which aren't handling some case like expanded variables. Regular expressions should be redefined to include all variables.
This plugin is a core plugin without any UI concerns.
It must absolutely not depend on org.eclipse.ui. If we remove this dependency there is only one error on : PlatformUI.getPreferenceStore() to get ANALYZER_EP_CONTRIBUTOR_CHECK_ID.
It is better to use the IEclipsePreferenceService class like this (example found in FileHelper.class) :
String defaultLineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME,
Platform.PREF_LINE_SEPARATOR, platformDefaultLineDelimiter, null);
setInputFile(File file)
of lexical files must be restricted to only one file.
It would have been possible to reset the reader and all attributes of the class to solve this problematic however i-Code CNES is currently using multi-threading to run each files analysis by a rule concurrently.
In case of an anlysis failure during the TestGlobal test, the test is returned as a success.
Build warning indicates that the using encoding is Cp1252. Should be UTF-8
Analyzer are defining file extensions that are duplicated for instance for f77.metric and f77.rule.
It would be easier to have :
Then a kind of LanguageUtil class could find the language for a file or give the existing analyzer for a language...
The error message shown when running an analysis while not having selected a file should be edited to be more informative and corrected to not show anymore badly encoded characters.
In the plugin.xml tools.analyzer for instance we have :
This is an old usage. When an extension point is created the ID and the name can be the same.
It should be :
even if in the code we still use 'fr.cnes.analysis.tools.analyzer'
Should use this naming convention also for the previous issue #32 about language extension point
With ant it is possible to consider a directory content.
Currently i-Code Analyzer is designed to run an analysis with :
IPath
to run the analysis on;IPath
in it's Violation
& FileValue
objects returned by the analysis.We would like to improve it to be able to run an analysis on non-eclipse based thirds, and retrieving only one list of results instead of returning a List<Violation>
and a List<FileValue>
. This imply to have a common object for both metrics and violations analysis's result and should be realized with a fusion of the two analysis which are independant for now.
Currently, selecting the command Clear views do not total clear stored results, which still can be exported while the view is empty.
Currently, running an analysis is accessible only from the menu ** i-Code CNES > Check Code **. A new button should be added directly with an icon to run the analysis similar to the Eclipse's run button.
In some of the lex files, the trim() function was badly used on the string to retrieve function's name.
It could be a good idea to manage the parameters in the extension point definition rather than in the code with a 'hasParameters' method to be implemented (without providing a method to know what are the parameters...).
Actually parameters are guessed by calling 'getParameters', if they have been initialized in the exporter's constructor.
If the exporter extension point provides the parameter definition, in its schema, it would be easier to manage them and to define the comment for each. A parameter could contain : name, required/optional, description, ....
Then this list of parameters can be reused to initialize the export wizard and to initialize properly the expected parameters list for export...
This issue concerns also importers when they will be defined.
Although the ImageFactory
class was added to put images in preferences pages complying the new extension points created in #33 issues, some class are still reaching images in resources folder by their file path which might cause evolution problem.
All images and resources pictures should be accessed thanks to the ImageFactory
class.
When changing configuration, the checkbox of the rules and of the table aren't updated and keep their old status while the checker is being enabled.
This should be fixed to let the user aknowledge configuration chosen when applying the configuration.
XML export is craching (nullpointerException)
Map "parameters" in CheckerFileCreationExportWizardPage is not initialized and not set with user values in ExportXml.
Currently, annalysis failure result by throwing a JFlexException
, however :
At least a few automatons should be added inside the documentation and explained.
The metrics view is difficult to read because it's both too colorfull and not informative enough.
This view should be edited to show severity set on the metric and also to show if the metric was violated or not.
Some functions locations in lex files (except metrics) is not defined correctly, this is especially the case for :
Regular expression used by the rule SH.INST.GetOpts
to identify $1
argument call was set using LEX pattern instead of JAVA pattern.
markerProblem = file.createMarker(IMarker.PROBLEM);
(line 519 of ViolationsView class)
The variable file
raise a warning from java because it might have null value during it's use.
jflex generation could be defined in parent pom.xml
In the version 1.0, both ViolationView
and MetricsView
were both extending the same class which was extending manifold classes making views editing and independencies difficult. ViolationView
was edited to not use it anymore however MetricsView
which is independent of any other view is still extending numerous abstract classes instead of ViewPart
.
This class should be edited to limit complexity of the MetricsView
and clarify the architecture of the plug-in UI.
Some of the Shell's lex files contains %ignorecase parameter which make the parser identifying regular expression ignoring the case while the case must be active on shell.
The following metrics should be corrected to be available in version 3.0 :
For shell languages, it's possible to declare a new function by several ways. However, some analyzers require the shell function to be declared with the keyword function
before the function's name while it's optional.
Adding a new transition FUNCT to handle this declaration independantly to the keyword one on function declaration to retrieve function's name.
Also, make FUNCT identifier using FNAME identifier as function's name instead of VAR one.
In some project, the presence of .checkstyle
which is dependent of user's configuration is versioned in git. This configuration file shouldn't be included in the project.
In case a violation was set as "Error" severity, the line containing the violation should be highlighted with a ligth red color.
Extension point fr.cnes.analysis.tools.services.exd defines a source provider unused.
To be removed.
In it's version 2.0, i-Code CNES analyzers are running analysis for the following files extensions :
fr.cnes.analysis.tools.fortran77.analyzer
: .ffr.cnes.analysis.tools.fortran90.analyzer
: .f90fr.cnes.analysis.tools.shell.analyzer
: .sh, .bash, .kshThe different standard of fortran 77[1][2], fortran 90[3], and Shell[4] do not define file extensions, however following the gfortran
[5] & PGI Fortran
[6] compilers documentation, and CNES-RNC-SHELL Rule SH.DESIGN.Bash
, the following files extensions should be defined :
fr.cnes.analysis.tools.fortran77.analyzer
: .f, .for, .fpp, .ftn, .F, .FOR, .FPP,.FTNfr.cnes.analysis.tools.fortran90.analyzer
: .f90, .F90fr.cnes.analysis.tools.shell.analyzer
: .sh, .bash, .ksh[1]Departement of Defense Military standard for Fortran 77 : ftp://ftp.nag.co.uk/sc22wg5/ARCHIVE/mil_std_1753.html
[2]Fortran 77 ISO Standard
[3]Fortran 90 ISO Standard : ftp://ftp.nag.co.uk/sc22wg5/N001-N1100/N692.pdf
[4]IEEE Std 1003.1
[5]gfortran documentation
[6]PGI Fortran 77 documentation
[6bis]PGI Fortran 90 documentation
Violation and FileValue are very similar, it could simplify treatments to consider them as a simple checkResult.
The names for export management are confusing. We have :
These names would be more convenient :
If we use the pure E4 injection context, we will provide both services in the context. If we still use E3 development, we will provide a singleton in services to get the default implementation. For instance : IExportService.getDefault() will return the internal implementation or better, the ExportService is declared in an OSGi component file. This will simplify also the tests if we want to provide other importer/exporter.
JFlex is used to generate java code in *rules and *metrics project.
The default version used for f77 and f90 projects is flex 1.6.1. Unfortunately this version can not be used once for all projects.
The shell project must be updated to use the 1.6.1 jflex version and the jflex1.4.1 can then be removed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.