Comments (13)
Hi @difeijin,
Please rewrite your issue like in the template we provide.
It seems to be a specific C# plugin related issue(C# metric) , but we need more information about your use case to reproduce it and fix it.
Regards,
Benoît
from sonar-cnes-report.
Please use edit
feature of GitHub issues instead of duplicating them.
from sonar-cnes-report.
@difeijin I gather all your information in that issue.
Could you provide us your list of installed plugins and their versions?
from sonar-cnes-report.
I have a similar issue. I don't think it is related to C# as I am using PHP (my guess). The errors line are exact.
I have very limited plug-ins installed, all are the default from SonarQube installation. CNES is the only plug-in I added.
from sonar-cnes-report.
Hello @astrasia,
Could you send us the content of 404.php
, or a piece of project with which we can reproduce thius error?
Thanks.
from sonar-cnes-report.
Hi @astrasia,
Just a quick reminder.
In order to investigate, we really need an example file that triggers this error.
Thanks !
from sonar-cnes-report.
from sonar-cnes-report.
from sonar-cnes-report.
I reproduce the error.
When we extract the component_tree measures in the Component provider. The getMinMetric and the getMaxMetric try to parse the file name of the component tree to double.
I saw that type of error on files that has numbers on the file name.
404.jsp
3A
1E
I change the next methods:
private double getMinMetric(String metric){
double min = Double.MAX_VALUE;
for(Map c: componentsList){
final String rawValue = (String)c.get(metric);
if(rawValue!=null){
try{
min = Math.min(min, Double.valueOf(rawValue));
}catch(NumberFormatException e){
LOGGER.warning(metric +" : "+rawValue+" | Error Min" );
min = 0;
}
}
}
return min;
}
/**
* Get max value for a specified metrics
* */
private double getMaxMetric(String metric){
double max = -Double.MAX_VALUE;
for(Map c: componentsList){
final String rawValue = (String)c.get(metric);
if(rawValue!=null){
try{
max = Math.max(max, Double.valueOf(rawValue));
}catch(NumberFormatException e){
LOGGER.warning(metric +" : "+rawValue+" | Error Max" );
max = 0;
}
}
}
return max;
}
And then the reports generated.
from sonar-cnes-report.
from sonar-cnes-report.
Hi @Eduardx05 !
Thanks for your feedback and contribution, we truly appreciate it !
We're also glad you managed to reproduce this error... that was a tricky one.
I can't say when, but be sure I'll look into it as soon as possible.
from sonar-cnes-report.
I stumbled upon this issue too and I needed badly to generate a report lol
You have to be lucky to reproduce this on your side. It happens inside src/main/java/fr/cnes/sonar/report/providers/ComponentProvider.java
, when the very first component value used inside isCountableMetric(String metric)
is actually a valid number.
Here is a typical component and its attributes:
{Path=include/fieldbus/488, complexity=0, duplicated_lines_density=0.0, cognitive_complexity=0, ncloc=41, ID=AXTj4p-qHIPsNopKiPtX, comment_lines_density=42.3, Name=488}
488
in this particular case means IEEE-488 or GPIB field bus.
When calling isCountableMetric("Name")
: the first non-null value is used to detect if the metric is countable, and NumberUtils.isCreatable("488")
is indeed TRUE!
Then, the metric Name
is also computed for all components in getMetricStats()
, calling getMinMetric(String metric)
and getMaxMetric(String metric)
, as reported by @Eduardx05, leading to the java.lang.NumberFormatException on all file names and directory names. The suggested fix pointed me to this analysis, but it is too late during the runtime.
Fix idea: exclude known attributes not to be in the computed metrics, such as Name
or Path
, not relying on their value. This will give a deterministic behavior, independently from the component order or name.
At least, that's what I found and it works on my setup.
Associated PR #179
from sonar-cnes-report.
Hi @jeritiana
Thanks a lot or your contribution !
That was a tricky one indeed.
We will have a look at your PR as soon as possible, as it would be great to merge it for the next 3.3.0 release.
from sonar-cnes-report.
Related Issues (20)
- CNES 4.2 fails to display project options in SonarQube LTS 9.9.1 HOT 1
- Label translation fails HOT 1
- java.lang.IllegalArgumentException: Illegal group reference
- support for 10.1.* version HOT 6
- Sonar-cnes report generate issue HOT 9
- Have an expiry for the Sonar Auth Tokens, when the plugin creates one for the user HOT 1
- Unable to generate the report HOT 1
- Can return only the first 10000 results. 10500th result asked. HOT 1
- Add Git informations in the report
- Broken CI
- sonar-cnes-report whether there is a limit on the amount of exported data HOT 1
- Gitlab CI doesn't close the milestone
- An error has occurred. Please contact your administrator HOT 2
- HTML character issue in generated Docs report HOT 1
- SonarQube > 10.0 - text and buttons text labels instead of translated text HOT 1
- javascript issues caught in sonarqube dashboard missing in cnes report
- Error CNES Report on plugin HOT 5
- Display closed issues in the report HOT 1
- This SonarQube version is not supported by this cnesreport version HOT 1
- Sonarqube UI v10.4.1 showing internal element names instead of the proper text because of CNES-REPORT plugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonar-cnes-report.