Giter Site home page Giter Site logo

cnescatlab / sonar-frama-c-plugin Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 6.0 2.74 MB

sonar-frama-c-plugin is a plugin sonarqube to integrate frama-c results

License: GNU General Public License v3.0

Java 64.83% Shell 12.00% C 11.80% SWIG 5.91% Assembly 5.46%
frama-c sonarqube-plugin c sonarqube quality analysis

sonar-frama-c-plugin's People

Contributors

at-nicolasmetivier avatar begarco avatar cfranccyrille avatar diegorodriguez31 avatar dupuisa avatar louisjdmartin avatar s229369 avatar sancretor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sonar-frama-c-plugin's Issues

One result file can provide data about multiple source file

Expected behavior

A Frama-C result file is abble to provide information about multiple source file. This kind of file should be importable.

Actual behavior

Results with data about multiple source file is not importable.

Steps to reproduce behavior

Try the plugin on this kind of result.

Detection version

  • Plugin version: V1
  • SonarQube version: 6.7.4

Change plugin artifactId

Expected behavior

This plugin should have a simpler id to be integrate in the SonarQube marketplace.

Actual behavior

The name contains '-'.

Detection version

1.0.0

Support Frama-C 18 Chlorine results

Expected behavior

This plugin should be compatible with Frama-C 18 Chlorine.

Actual behavior

This plugin is compatible with Frama-C 15.

Detection version

1.0.0

Execution successful but not showing the report/result

will it work with sonarqube version 7.6?

INFO: User cache: /scratch/home/csi-install/.sonar/cache
INFO: SonarQube server 7.6.0
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/scratch/home/csi-install/.sonar/cache/993f707e3af7ba4f46f121039128516b/sonar-scanner-engine-shaded-7.6-all.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Load global settings (done) | time=94ms
INFO: User cache: /scratch/home/csi-install/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=65ms
INFO: Load/download plugins (done) | time=119ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=5ms
INFO: Project key: ORS_BRM
INFO: Base dir: /scratch/home/csi-install/sonar/test-brm/
INFO: Working dir: /scratch/home/csi-install/sonar/test-brm/.scannerwork
INFO: Load project settings
INFO: Load project settings (done) | time=17ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=68ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=82ms
INFO: Load active rules
INFO: Load active rules (done) | time=2896ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=65ms
WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: /custom/
INFO: 251 files indexed
INFO: 2188 files ignored because of inclusion/exclusion patterns
INFO: ------------- Run sensors on module ORS_BRM
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=6ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=5ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=19ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=48ms
INFO: ------------- Run sensors on project
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 116ms, dir size=73 KB
INFO: Analysis report compressed in 15ms, zip size=10 KB
INFO: Analysis report uploaded in 27ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=ORS_BRM
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://localhost:9000/api/ce/task?id=AXyeMb1j7EUBF0lP8KTy
INFO: Analysis total time: 6.297 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 8.000s
INFO: Final Memory: 7M/27M

image

Normalize Built-In Quality Profile

Expected behavior

The Built-In quality profile should contains rules and should be named Sonar way.

Actual behavior

The way use to declare the built-in quality profile is not correct. The good class is not used and it has a non common name.

Detection version

1.0.0

sonar.projectBaseDir ignored

Describe the bug

A clear and concise description of what the bug is.

When running sonar-scanner with the option sonar.projectBaseDir, report files are not found.

To reproduce

Steps to reproduce the behavior.

  1. Analyse a C/C++ project with Frama-C and produce output files (**/*.csv and **/*.out)
    • frama-c file.c -rte -metrics -report-csv frama-c.csv > framac-results.out
  2. Write a minimal sonar-project.properties if not already done
    • sonar.projectKey=my-project
      sonar.projectName=My Project
      sonar.projectVersion=1.0
      sonar.sources=src
      
  3. Run sonar-scanner from a different folder with the option sonar.projectBaseDir
    • sonar-scanner -Dsonar.projectBaseDir=/path/to/project
  4. In sonar-scanner output, look for lines similar to
    • WARN: Results file frama-c.csv has not been found and wont be processed.
      WARN: Results file framac-results.out has not been found and wont be processed.
      

This output tells us that result files were found when sonar-scanner looks for files to collect but were not found later when trying to import then.

Expected behavior

A clear and concise description of what you expected to happen.

The result files should be imported correctly. The base directory from which the sensor looks for these files should be sonar.projectBaseDir.

Screenshots & log

If applicable, add screenshots to help explain your problem. Then, append SonarQube log and do not forget to obfuscate them._

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /usr/src/tests/c_cpp/sonar-project.properties
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.8 Debian (64-bit)
INFO: Linux 4.15.0-112-generic amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /usr/src/tests/c_cpp/sonar-project.properties
INFO: Analyzing on SonarQube server 7.9.4
INFO: Default locale: "en_US", source code encoding: "US-ASCII" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=93ms
INFO: Server id: BF41A1F2-AXRsiTfL4ce7qAj-yTQm
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=37ms
INFO: Load/download plugins (done) | time=114ms
WARN: Plugin SonarQube CNES Report [cnesreport] uses a child first classloader which is deprecated
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: framac-dummy-project
INFO: Base dir: /usr/src/tests/c_cpp
INFO: Working dir: /usr/src/tests/c_cpp/.scannerwork
INFO: Load project settings for component key: 'framac-dummy-project'
INFO: Load project settings for component key: 'framac-dummy-project' (done) | time=96ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=49ms
INFO: Load active rules
INFO: Load active rules (done) | time=5404ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 7 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for c++: CNES_CPP_A
INFO: ------------- Run sensors on module Frama-C Dummy Project
WARN: Component of type class org.sonar.plugins.findbugs.FindbugsConfiguration defines methods start() and/or stop(). Neither will be invoked to start/stop the component. Please implement either org.picocontainer.Startable or org.sonar.api.Startable
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=63ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/opt/sonar-scanner/.sonar/cache/866bb1adbf016ea515620f1aaa15ec53/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=9ms
INFO: Sensor SonarFrama-C [framac]
WARN: Results file .scannerwork/class-mapping.csv has not been found and wont be processed.
WARN: Results file frama-c.csv has not been found and wont be processed.
WARN: Results file framac-results.out has not been found and wont be processed.
WARN: No results file found for Frama-C.
INFO: Sensor SonarFrama-C [framac] (done) | time=9ms
INFO: Sensor C++ (Community) SquidSensor [cxx]
INFO: Load project repositories
INFO: Load project repositories (done) | time=12ms
WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.
INFO: Sensor C++ (Community) SquidSensor [cxx] (done) | time=556ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=12ms
INFO: SCM provider for this project is: git
INFO: 7 files to be analyzed
INFO: 7/7 files analyzed
INFO: 6 files had no CPD blocks
INFO: Calculating CPD for 1 file
INFO: CPD calculation finished
INFO: Analysis report generated in 57ms, dir size=164 KB
INFO: Analysis report compressed in 26ms, zip size=35 KB
INFO: Analysis report uploaded in 72ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://lequalsonarqube:9000/dashboard?id=framac-dummy-project
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://lequalsonarqube:9000/api/ce/task?id=AXRskApY4ce7qAj-yajg
INFO: Executing post-job 'Final report'
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
INFO: Analysis total time: 8.254 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 9.094s
INFO: Final Memory: 14M/57M
INFO: ------------------------------------------------------------------------

User environment

Please complete the following information.

  • OS: Debian 10.5
  • Java version: 11.0.8
  • SonarQube version: 7.9.4
  • Plugin version: 2.1.1

Additional context

Add any other context about the problem here.

Good starting point

Source and result file names must be independant

Expected behavior

The Frama-C result file must be named and placed independently from analyzed source files.

Actual behavior

Currently, the result file must be named like the analyzed source file (+ result file extension) and the result folder must be place at the same tree-level.

Detection version

  • Plugin version: V1
  • SonarQube version: 6.7.4

Delete useless log

Expected behavior

There shouldn't be too much log.

Actual behavior

There are too much log in sonar-scanner execution trace.

Detection version

1.0.0

Use sonar-cxx and sonar-cfamily as dependencies

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Today, Frama-C plugin is not related C language defined by CFamily or sonar-cxx. It adds a new language with its own quality profiles.

Describe the solution you'd like

A clear and concise description of what you want to happen.

Consider making it dependant of sonar-cxx or sonar-cfamily depending on which one is installed on the SonarQube instance and use their defined language.

Frama-C plugin shall not be run if not requested

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Even if no C code is present Frama-C plugin execute itself during sonar-scanner call.

Describe the solution you'd like

A clear and concise description of what you want to happen.
I would like to the plugin execute only when we analyze C code (or C++) or when plugin's property is set.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.
None for now

Additional context

Add any other context or screenshots about the feature request here.
None

Add a README

Expected behavior

There should be a consistent README.

Actual behavior

There is no real README.

Detection version

1.0.0

Use SonarQube metrics

Expected behavior

Metrics reported in the measure view must reflect what Frama-C export in analysis report.

Actual behavior

Metrics import do not use standard SonarQube metrics but duplicate concepts by creating many new metrics to save few measures.

Detection version

  • Plugin version: V1
  • SonarQube version: 6.7.4

Configurable Frama-C command

Connected to Issue #21

Expected behavior

User should be able to configure the frama-c command line used by the AutoLaunch feature.

Actual behavior

User has no way to set the command, it's hardcoded.

Steps to reproduce behavior

Install Plugin, and go in "Administration/Frama-C" window.

Detection version

dev-ATOS branch (2.0.0-dev)

Display custom metrics is broken

Expected behavior

Metrics should be displayed in standart SonarQube metrics.

Actual behavior

There is a bad custom metrics view.

Steps to reproduce behavior

Look at the view.

Detection version

  • Plugin version: V1
  • SonarQube version: 6.7.4

Autolaunch Frama-C

Expected behavior

User should be able to choose to autolaunch Frama-C on analysis.

Actual behavior

User has to run Frama-C by himself before using sonar framac.

Steps to reproduce behavior

Detection version

1.0.0

Sensor must analyze all the project tree

Expected behavior

When analyzing a project, sensor must browse all files in sub-folders.

Actual behavior

Files in subfolders are ignored.

Detection version

  • Plugin version: V1
  • SonarQube version: 6.7.4

Support Frama-C 20

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

This plugin should be aligned with the Frama-C releases.

Describe the solution you'd like

A clear and concise description of what you want to happen.

Add support of Frama-C 20.

Conflicts between sonar-cxx and sonar-framac

Expected behavior

sonar-cxx and sonar-framac should be able to run side by side.

Actual behavior

There is a conflict between extension files that are associated to both c++(sonar-cxx) and frama-c(sonar-framac) languages. For example : *.c, *.h, *.i, etc.

Steps to reproduce behavior

Install both plugin and run an analysis.

Detection version

1.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.