-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add 'cannot find the file...' only once #1619
add 'cannot find the file...' only once #1619
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @guwirth)
cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxIssuesReportSensor.java, line 145 at r1 (raw file):
LOG.warn
I know, that the previous severity (DEBUG
) doesn't match with the severity from below (WARN
). This doesn't look right. However I disagree with making this trace to WARN
. The reason is that for multi-module projects there will be too many warnings.
I've described this situation using the coverage import as example. Please see #1508 (comment) . Similar can happen when importing one single (large) e.g. cppcheck report for multiple (small) modules.
Not sure which solution would be correct. Ideally there should be some code like...
if processing_one_of_many_modules(sensorContext):
LOG.debug()
else:
# processing the single-module project
LOG.warn()
... I don't know if it's possible to determine the condition processing_one_of_many_modules
reliable.
@ivangalkin this PR is an improvement to the current state. Current solution add warnings even if files are already in notFoundFiles. I moved the warning to getInputFileIfInProject. Maybe not perfect but much better. |
@guwirth I agree, it's better. After some second look at the functions
I believe, that the first one will produce less noise. Some background.
That means, that the same warning for some particular file path might appear multiple times per module/project. But it appears only once per sensor, because results of
So it's ok from my side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @guwirth)
- reduce the noise in LOG file - add 'cannot file the file...' only once per file in CxxIssuesReportSensor
@ivangalkin thx. Let's test it and further improve it in next version... |
This change is