GithubHelp home page GithubHelp logo

cnescatlab / sonar-cnes-report Goto Github PK

View Code? Open in Web Editor NEW
409.0 28.0 150.0 4.27 MB

Generates analysis reports from SonarQube web API.

License: GNU General Public License v3.0

Java 96.11% JavaScript 3.86% CSS 0.03%
sonarqube-reports cnes docx xlsx sonarqube quality plugin reporting report export

sonar-cnes-report's People

Contributors

amthmsexprn avatar barbaraips avatar begarco avatar clemensutschig avatar datzatwork avatar dependabot[bot] avatar dev31520 avatar diegorodriguez31 avatar don-vip avatar erwangauduchon avatar gbonnefille avatar jeritiana avatar jhonemu avatar johnrballard avatar louisjdmartin avatar sancretor avatar sirrrich avatar thomasgl-orange avatar topin2001 avatar un0tec avatar xvier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonar-cnes-report's Issues

Add support of SonarQube 5 LTS

Expected behavior

Cnesreport should be able to export SonarQube 5 LTS projects.

Actual behavior

Cnesreport is able to export SonarQube 5 projects in a specific branch.

Steps to reproduce behavior

Launch cnesreport on SonarQube 5 LTS: it fails.

Detection version

1.2.1

CNES report still contains french vocabs in docx report

Expected behavior

when language (-l) is provided - all vocabs and label have to switch

Actual behavior

docx still contains french vocabs

Steps to reproduce behavior

run cnes reports and check

Detection version

1.2.1 latest

Unable to access jarfile sonar-report-cnes.jar

Expected behavior

Execute the tool

Actual behavior

Executing the command java -jar sonar-report-cnes.jar --sonar.token xxx --sonar.url http://54.77.33.180 --sonar.project.id xxx --report.template ./template.docx --report.locale en_EN I received the error 'Unable to access jarfile'. Tried both on Linux and Windows 10, Java 8.

Steps to reproduce behavior

Execute the comand java -jar sonar-report-cnes.jar --sonar.token xxx --sonar.url http://54.77.33.180 --sonar.project.id xxx --report.template ./template.docx --report.locale en_EN I received the error 'Unable to access jarfile'

Detection version

1.2.1

[BUG] Inconherent severity level between SonarQube Analysis and report

Expected behavior

In the word report :

  • Exceptions should not be thrown in finally blocks --> MAJOR
  • Empty statement --> CRITICAL

Actual behavior

bug

In the word report :

  • Exceptions should not be thrown in finally blocks --> CRITICAL
  • Empty statement --> MINOR

Steps to reproduce behavior

DEBRISK 3.0.a1 code analysis

Detection version

Improve issues' policy and templates

Expected behavior

The community should be able to correctly express their needs and issues by using strong process and templates. Use common templates and community documentation for all lequal projects (see i-Code for example).

Actual behavior

Templates and community policy are not used.

Steps to reproduce behavior

NA

Detection version

NA

Remove deprecated API parameters

Expected behavior

Do not use deprecated API parameters

Actual behavior

Use of multiple deprecated APIs parameters (e.g. componentKey)

Steps to reproduce behavior

Detection version

2.1.0

Release is not a plugin for SonarQube 6.7.1

Hi,

I downloaded the release v1.1.0 and tried to load it in SonarQube 6.7.1, which fails with the message

2018.03.16 09:04:17 ERROR web[][o.s.s.p.Platform] Web server startup failed: File is not a plugin. Please delete it and restart: C:\dev\sonarqube-6.7.1\extensions\plugins\sonar-cnes-report-1.0.jar

I also tried it by cloning the repo and build it with maven, but with the same result.

NullPointerException in version 5.6.1

while running the project, I'm getting the following error:
Exception in thread "main" java.lang.NullPointerException
at fr.cnes.sonar.report.model.Project.getQualityProfiles(Project.java:140)
at fr.cnes.sonar.report.providers.ProjectProvider.getProject(ProjectProvider.java:69)
at fr.cnes.sonar.report.factory.ReportFactory.create(ReportFactory.java:96)
at fr.cnes.sonar.report.ReportCommandLine.report(ReportCommandLine.java:185)
at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:149)

The following url is being invoked:
http://illin018:9000/api/navigation/component?componentKey=amdocs.att:cm-sonar:Att-1000

Output Json:
{"key":"amdocs.att:cm-sonar:Att-1000","uuid":"AVcYA0Y_5AdzXx0lNlJ0","name":"ABP:CM Att-1000","isComparable":true,"canBeFavorite":true,"isFavorite":true,"dashboards":[{"key":10003,"name":"Dashboard"},{"key":10004,"name":"Hotspots"},{"key":10005,"name":"Reviews"},{"key":10006,"name":"TimeMachine"},{"key":10940,"name":"Issues"},{"key":11160,"name":"Sqale"},{"key":11300,"name":"SCM Stats"},{"key":12300,"name":"Moti"}],"version":"1000-SNAPSHOT","snapshotDate":"2018-09-13T03:56:58+0300","extensions":[{"url":"/plugins/resource/amdocs.att%3Acm-sonar%3AAtt-1000?page=CsvExportPage","name":"CSV Export"}],"breadcrumbs":[{"key":"amdocs.att:cm-sonar:Att-1000","name":"ABP:CM Att-1000","qualifier":"TRK"}]}

looks like Quality Profile is not coming in the Json output, any idea?

Error generation report Exception in thread "main" org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException:

Hi.
Im trying to generate a report from a project.
SonarQube version: 6.4
Server side OS: Ubuntu 16
Client side OS: No client side, a checkout is in the ubuntu server
i have the issues-template.xlsx, code-analysis-template.docx and sonar-report-cnes.jar in same directory.

java -jar sonar-report-cnes.jar --sonar.url http://localhost:9000 --sonar.project.id myID--report.template template.docx --report.locale en_US

Jul 04, 2018 4:54:09 PM fr.cnes.sonar.report.input.ParamsFactory create
INFO: Successfully processed parameters.
Exception in thread "main" org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException: No valid entries or contents found, this is not a valid OOXML (Office Open XML) file
at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:286)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:756)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:327)
at fr.cnes.sonar.report.exporters.docx.DocXExporter.export(DocXExporter.java:123)
at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:165)
Any idea? Thank you

Export issues' comments

Expected behavior

Issues report should provide comments for resolved issues.

Actual behavior

Comments are not exported.

Steps to reproduce behavior

Generate reports on a project with resolved issues.

Detection version

1.2.1

NullPointerException on SonarQube 7.1

I'm getting NPE when running against SonarQube 7.1. Is that a configuration problem or the tool is working only with LTS Sonar? Thanks.

> java -jar sonar-cnes-report.jar --sonar.token d7d762b60aa6c40cfec4b42882cba7c68f836337 --sonar.url http://localhost:9000 --sonar.project.id cz.wincor.journal:UCMS --report.template ./template.docx --report.locale en_US

Exception in thread "main" java.lang.NullPointerException
        at fr.cnes.sonar.report.providers.LanguageProvider.getLanguage(LanguageProvider.java:67)
        at fr.cnes.sonar.report.providers.ProjectProvider.getProject(ProjectProvider.java:70)
        at fr.cnes.sonar.report.factory.ReportFactory.create(ReportFactory.java:96)
        at fr.cnes.sonar.report.ReportCommandLine.report(ReportCommandLine.java:185)
        at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:149)

Detection version

cnesreport 1.2.1

Summary report

Expected behavior

cnesreport

Actual behavior

Steps to reproduce behavior

Detection version

Can I export report.
Only Summary(Don't need detail.)
Have template only summary information?
or have technique to export only summary information?

Add it tests

Expected behavior

There should be integration tests to automaticaly check compatibility with each SonarQube version.

Actual behavior

IT tests are manually run.

Steps to reproduce behavior

N/A

Detection version

1.2.1

Add compatibility matrix

Expected behavior

Add a compatibility matrix to the README to provide information about which version of cnesreport supports wich SOnarQube version.

Actual behavior

There are no centralized information.

Steps to reproduce behavior

N/A

Detection version

1.2.1

[Enhancement] Adding support for private projects

I think your tool can be very helpful, and I would like to use it in my SonarQube setup. Unfortunately, we have multiple users; and for security reasons, all projects are marked private and are only visible to specific users (usually only the project creator). Therefore, if an authorised user wants to generate reports with your tool, she needs to provide credentials that your tool can use to access the project.
Currently, this is not possible, and your tool crashes, due to insufficient privileges:

Mar 26, 2018 6:09:22 PM fr.cnes.sonar.report.input.ParamsFactory create
INFO: Successfully processed parameters.
Mar 26, 2018 6:09:22 PM fr.cnes.sonar.report.ReportCommandLine main
SEVERE: [WARN] Impossible to create the following directory: ./conf
Mar 26, 2018 6:09:23 PM fr.cnes.sonar.report.ReportCommandLine main
SEVERE: Insufficient privileges
fr.cnes.sonar.report.exceptions.BadSonarQubeRequestException: Insufficient privileges
        at fr.cnes.sonar.report.providers.AbstractDataProvider.isErrorFree(AbstractDataProvider.java:261)
        at fr.cnes.sonar.report.providers.AbstractDataProvider.request(AbstractDataProvider.java:294)
        at fr.cnes.sonar.report.providers.MeasureProvider.getMeasures(MeasureProvider.java:61)
        at fr.cnes.sonar.report.factory.ReportFactory.create(ReportFactory.java:82)
        at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:138)

Mar 26, 2018 6:09:23 PM fr.cnes.sonar.report.ReportCommandLine main
INFO: Welcome to Sonar Report CNES
Here are the list of parameters you can use:
  > --sonar.url [mandatory]
  > --sonar.project.id [mandatory]
  > --report.author
  > --report.date
  > --report.path
  > --report.conf [yes|no]
  > --report.locale [fr_FR|en_US]
  > --report.template
  > --issues.template
Example :
java -jar sonar-report-cnes.jar --sonar.url http://sonarqube:9000 --sonar.project.id cat

As a quick fix, I tried to provide the credentials as part of the URL; i.e. instead of calling your tool with http://example.com:9000, I used http://username:[email protected]:9000. Unfortunately, that caused the same issue. (It works when accessing the SonarQube Web API with Linux's curl, but not with a browser or your tool.)

I would be very grateful if you could add support for projects marked private by implementing an authentication process in your tool.

For testing purposes, I added some authentication in the get function of your RequestManager. At first glance, this seems to solve the problem, and no other classes are impacted.
Unfortunately, this approach used credentials which were hard-coded. For proper usability, the credentials should be provided by the user as a parameter, and flowed down into the RequestManager. Thus, the impact of the change is less constricted, which is why I come to you here instead of fiddling around with your code myself.
For your convenience, I attach my version of the RequestManager.java with the hard-coded authentication. It is based on the first few hits that I got on google, so it might not be the most elegant solution ;-) It also has no error handling in case of invalid credentials, etc. But it might be a useful starting point for you.

RequestManager_edited.zip

Add support of SonarQube 7

Expected behavior

Cnesreport should be able to export SonarQube 7 projects.

Actual behavior

Cnesreport is able to export SonarQube 5 & 6 projects.

Steps to reproduce behavior

Launch cnesreport on SonarQube 7.3: it fails.

Detection version

1.2.1

Does not support trailing slash in server's URL

Expected behavior

Works with -p https://sonar.corpo.rate:9000/

Actual behavior

Fails with:

[ERROR] com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12 path $
[ERROR] Server answered: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  <title>SonarQube (404)</title>
  <style type="text/css">
    body {
      background-color: #fff;
      color: #666;
      text-align: center;
      font-family: arial, sans-serif;
    }

    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }

    h1 {
      font-size: 100%;
      color: #f00;
      line-height: 1.5em;
    }
  </style>
</head>

<body>
<!-- This file lives in public/404.html -->
<div class="dialog">
  <h1>The page you were looking for doesn't exist.</h1>

  <p>You may have mistyped the address or the page may have moved.</p>

  <p>
    <a href="/">Go back to the homepage</a>
  </p>
</div>
</body>
</html>
 com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 12 path $
SonarQube online: false
[ERROR] Impossible to reach SonarQube instance.

Steps to reproduce behavior

See above.

Detection version

2.0

cnesreport does NOT work in corporate proxy network and lacks detailed error message

Expected behavior

plugin can connect to sq instance in guarded proxy environment

Actual behavior

[ERROR] Impossible to reach SonarQube instance.
SonarQube online: false

Steps to reproduce behavior

try to run cnesreport.jar behind proxy - where sonarqube is also within the same proxy network.
Tried -D java system properties (non proxy, ... ), and also POSIX ... neither made a difference, and NO usefull error was shown.

SQ is up and running and can be reached thru browser.

URL format used
-s https://sonarqube-cd.<domain>

Detection version

1.2.1 - latest -> against sq7.3

Add export feature for CSV and Markdown

Expected behavior

User should be able to generate a SonarQube Report in CSV and Markdown format.

Actual behavior

Only Docx and Xlsx format available

Steps to reproduce behavior

Detection version

All versions

Check command line arguments validity/reliability

Expected behavior

A bad argument should be handle for each option.

Actual behavior

If a bad argument is passed through command line, app can crash.

Steps to reproduce behavior

Use for example blabla for -l option.

Detection version

2.0.0

fail to generate report

Expected behavior

generate report

Actual behavior

error happen

Steps to reproduce behavior

in sonarqube webui,more ->generate cnes report ,select project key , click generate
HTTP Status 500 – Internal Server Error
Type Status Report

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Detection version

cnesreport version: 3.1.0
SonarQube version: 7.3.1

Version 2.1.0 Does not work with corporate proxy

Expected behavior

Should work with corporate proxy

Actual behavior

Does not work with corporate proxy

Steps to reproduce the behavior

Jar version: 2.1.0 with BigFix #41

From corporate proxy issue command:

  1. java -Dhttps.proxyHost=proxyServer.com -Dhttps.proxyPort=8080 -jar cnesreport.jar -t sonar_analisys -s http://192.168.214.162:19000 -p ProjectTMSearch -r ./code-analysis-mssearch-template.docx
  2. it still results in output
    [ERROR] Server answered:
    ....

URL: http://192.168.214.162:19000/api/system/status




La connexion 192.168.214.162 a ΘchouΘe

Pour signaler cette erreur merci de faire un IT Support.



SonarQube online: false [ERROR] Impossible to reach SonarQube instance.

Detection version

2.1.0

Add a new feature to extract Security Reports

Expected behavior

The Sonar CNES Report should be able to collect and report the various security reports added in SonarQube 7.3 :

  • Add Security Hotspot with the issues list
  • Add a new chapter with OWASP Top 10, and SANS Top 25 security reports

Actual behavior

It is not able to extract these data.

Steps to reproduce behavior

Use this tool on a SonarQube 7.3+ server.

Detection version

2.1.0

Exception in thread "main" java.lang.NumberFormatException: For input string: "AboveAverage.cs"

Expected behavior

generate report

Actual behavior

This error happens in web.log:

2019.09.28 00:03:57 ERROR web[][o.s.s.p.w.RootFilter] Processing of request /api/cnesreport/report?key=aspose.cells.0827&author=Administrator&token=d17e5de54d26dda886e4b4fed6fe2248670aa0d7&generation=Generate failed
javax.servlet.ServletException: Filter execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:87)
at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.NoClassDefFoundError: org/apache/poi/openxml4j/exceptions/OpenXML4JException
at fr.cnes.sonar.plugin.ws.ExportTask.handle(ExportTask.java:78)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:88)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:126)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
... 41 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.poi.openxml4j.exceptions.OpenXML4JException
at org.sonar.classloader.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:41)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 47 common frames omitted

Steps to reproduce behavior

java -jar sonar-cnes-report-3.1.0.jar -t 34ff2992bfa6f79a5118fa6297c15a8c514c23d4 -s http://192.168.1.240:9000 -p  xxxx
SonarQube URL: http://192.168.1.240:9000
SonarQube online: true
Detected SonarQube version: 7.9.1
Exception in thread "main" java.lang.NumberFormatException: For input string: "AboveAverage.cs"
        at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
        at sun.misc.FloatingDecimal.parseDouble(Unknown Source)
        at java.lang.Double.parseDouble(Unknown Source)
        at java.lang.Double.valueOf(Unknown Source)
        at fr.cnes.sonar.report.providers.ComponentProvider.getMinMetric(ComponentProvider.java:87)
        at fr.cnes.sonar.report.providers.ComponentProvider.getMetricStats(ComponentProvider.java:125)
        at fr.cnes.sonar.report.factory.ReportModelFactory.create(ReportModelFactory.java:101)
        at fr.cnes.sonar.report.ReportCommandLine.execute(ReportCommandLine.java:134)
        at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:77)

Detection version

cnesreport version: 3.1.0
SonarQube version: 7.9.1

Multi-version support

Expected behavior

Future version of cnesreport should support previously supported version of SonarQube.

Actual behavior

Each new version of cnesreport support only the current SonarQube version.

Steps to reproduce behavior

Use cnesreport 1.2.1 on SonarQube 5 LTS.

Plugin: Wrong error code/message with invalid token

Expected behavior

When providing an invalid token to api/cnesreport/report, get a clear error message and forwards the HTTP 401 error code returned by SQ.

Actual behavior

The plugin returns an HTTP error 500 with contents:

{"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}

Stacktrace in logs:

2019.06.25 20:45:01 ERROR web[AWuP4sX2eXrRrvKpAAC+][o.s.s.w.WebServiceEngine] Fail to process request http://xxx/sonar/api/cnesreport/report?key=validkey&author=me&token=foo
fr.cnes.sonar.report.exceptions.BadSonarQubeRequestException: Unauthorized error sent by SonarQube server (code 401), please provide a valid authentication token to cnesreport.
        at fr.cnes.sonar.report.providers.RequestManager.get(RequestManager.java:133)
        at fr.cnes.sonar.report.providers.AbstractDataProvider.stringRequest(AbstractDataProvider.java:321)
        at fr.cnes.sonar.report.providers.AbstractDataProvider.request(AbstractDataProvider.java:275)
        at fr.cnes.sonar.report.providers.ProjectProvider.hasProject(ProjectProvider.java:107)
        at fr.cnes.sonar.report.factory.ReportModelFactory.create(ReportModelFactory.java:93)
        at fr.cnes.sonar.report.ReportCommandLine.execute(ReportCommandLine.java:131)
        at fr.cnes.sonar.plugin.ws.ExportTask.handle(ExportTask.java:74)
        at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
        at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:88)

Steps to reproduce behavior

Detection version

Plugin 2.2.0 with SonarQube 7.6.

Project id vs project key

Hello, I'm using the lastest LTS (6.7.3) and it seems that the call api/measures/component no longer take the project id as parameter but only the project key.

Same thing with version 7.1

Perhaps you could add support for the project key as argument as well.

Refactor command line

Expected behavior

The goal is:

  • to have a standart command line
  • to use a standart command line library
  • to provide common options (help, version, etc)
  • to simplify old options

Actual behavior

The command line is handled manually and options are too complex.

Steps to reproduce behavior

Use a cnesreport version older than 1.2.1.

Detection version

1.2.1

How to run the sonar cnes

I downloaded the zip file and unzipped it. And when I excute the example command with my project id it is not running. Please help me .

cnes plugin does not support Sonarqube Community Edition V7.7

Expected behavior

Detected SonarQube version: 7.7.0
[ERROR] Unknown URL error sent by SonarQube server (code 404), please check cnesreport compatibility with your SonarQube server version.

Actual behavior

Steps to reproduce behavior

cnesreport 2.1.0
SonarQube version: 7.7.0

Detection version

cnesreport 2.1.0
SonarQube version: 7.7.0

branches support

Expected behavior

have report for different scm branches (for developer sonarqube license)

Actual behavior

report only for master branch

Steps to reproduce behavior

Detection version

Report Security

Hello , i want to give you a prestigious project:

I'm using in my work environment because I'm from the infrastructure area, and very good, very much so.

I Wanted to ask you if and possible general the OWASP reports Top 10 and SANS TOP 25 in docx?

NullPointerException when generating the report

Expected behavior

Generate the report

Actual behavior

{
"errors": [
{
"msg": "An error has occurred. Please contact your administrator"
}
]
}

Steps to reproduce behavior

I'm using docker with 7.9 LTS sonarqube, after selecting the project and clicking the generate button i get that api response instead of the file.

Detection version

3.0.0 plugin mode

Exporting Sonar metrics

Metrics are a very good way for s/w maintenability evaluation. And sonar-cnes-report is an effective tools for improving communication.

But sonar-cnes-report does not allow to export metrics.

Please, considers the possibility of exporting metrics.

Include default templates in jar file

Expected behavior

Final jar file should contain default report templates.

Actual behavior

Cnesreport does not work without providing default templates.

Steps to reproduce behavior

Use cnesreport without default templates.

Detection version

1.2.1

Null Pointer Exception in main

I may be doing this incorrectly, but there is a lack of documentation around how to use this. I haven't coded anything beyond hello world in java, so I'm not great at reverse engineering this. Here's the command I'm running

java -jar sonar-report-cnes.jar --sonar.url MYURLHERE --sonar.project.id 122 --report.template ./template.docx --report.locale en_US

and here's the output

Feb 26, 2018 4:48:08 PM fr.cnes.sonar.report.input.ParamsFactory create
INFO: Successfully processed parameters.
Exception in thread "main" java.lang.NullPointerException
at fr.cnes.sonar.report.providers.AbstractDataProvider.request(AbstractDataProvider.java:291)
at fr.cnes.sonar.report.providers.MeasureProvider.getMeasures(MeasureProvider.java:61)
at fr.cnes.sonar.report.factory.ReportFactory.create(ReportFactory.java:82)
at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:138)

Rename cnesreport

Expected behavior

The name of this program should be cnesreport.

Actual behavior

The name is sonar-cnes-report.

Steps to reproduce behavior

Build the project.

Detection version

1.2.1

exception happen

Expected behavior generate report

Actual behavior error happen

Steps to reproduce behavior

:\Users\peter\Downloads>java -jar sonar-cnes-report-3.1.0.jar -t 34ff2992bfa6f79a5118fa6297c15a8c514c23d4 -s http://192.168.1.240:9000 -p xxxx
SonarQube URL: http://192.168.1.240:9000
SonarQube online: true
Detected SonarQube version: 7.9.1
Exception in thread "main" java.lang.NumberFormatException: For input string: "AboveAverage.cs"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at sun.misc.FloatingDecimal.parseDouble(Unknown Source)
at java.lang.Double.parseDouble(Unknown Source)
at java.lang.Double.valueOf(Unknown Source)
at fr.cnes.sonar.report.providers.ComponentProvider.getMinMetric(ComponentProvider.java:87)
at fr.cnes.sonar.report.providers.ComponentProvider.getMetricStats(ComponentProvider.java:125)
at fr.cnes.sonar.report.factory.ReportModelFactory.create(ReportModelFactory.java:101)
at fr.cnes.sonar.report.ReportCommandLine.execute(ReportCommandLine.java:134)
at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:77)

Detection version

3.1.0 with sonaqube version 7.9.1

Support SonarCloud.io

Expected behavior

Enable report projects on SonarCloud.

Actual behavior

Because of organization feature enabled on SonarCloud, it is not possible to generate reports from SonarCloud.

Steps to reproduce behavior

Try to call cnesreport with sonarcloud url.

Detection version

1.2.1

Update libraries version

Expected behavior

Used library should be up to date.

Actual behavior

They are not.

Detection version

2.0.0

Reuse sonar-project.properties

Hi,

Thank you very much for this wonderful tool. Would you consider adding support for reading sonar-project.properties to get the needed info to connect to the server ?

Thanks

Template fails to load

The issues-template.xlsx file fails to load when running on Windows 10 Pro or on Ubuntu 17.10. Running sonar-cnes-report version 1.1.0. The file is not corrupt, as it can be opened using Excel on Windows.

java -jar sonar-report-cnes.jar --sonar.url http://localhost:9000 --sonar.project.id myproject --report.template ./code-analysis-template.docx --report.template ./issues-template.xlsx
Jun 06, 2018 7:33:57 PM fr.cnes.sonar.report.input.ParamsFactory create
INFO: Successfully processed parameters.
Exception in thread "main" org.apache.poi.POIXMLException: org.apache.xmlbeans.XmlException: Element workbook@http://schemas.openxmlformats.org/spreadsheetml/2006/main is not a valid document@http://schemas.openxmlformats.org/wordprocessingml/2006/main document or a valid substitution.
at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:237)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:169)
at org.apache.poi.xwpf.usermodel.XWPFDocument.(XWPFDocument.java:112)
at fr.cnes.sonar.report.exporters.docx.DocXExporter.export(DocXExporter.java:124)
at fr.cnes.sonar.report.ReportCommandLine.main(ReportCommandLine.java:165)
Caused by: org.apache.xmlbeans.XmlException: Element workbook@http://schemas.openxmlformats.org/spreadsheetml/2006/main is not a valid document@http://schemas.openxmlformats.org/wordprocessingml/2006/main document or a valid substitution.
at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:322)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1384)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1363)
at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:370)
at org.apache.poi.POIXMLTypeLoader.parse(POIXMLTypeLoader.java:164)
at org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument$Factory.parse(Unknown Source)
at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:152)
... 4 more

Produce a SonarQube plugin from the tool

Expected behavior

The CNES Report tool should be able to be directly embedded into SonarQube.

Actual behavior

CNES Report is only a standalone tool.

Steps to reproduce behavior

Detection version

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.