Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7013

CE should fail when lineCount in analysis report is inconsistent with source line count

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.4
    • Component/s: Compute Engine
    • Labels:
      None

      Description

      As discussed with the batch team, due to limitation of handling of the last empty of most API in Java to read files, analysis report must send source code as well as the number of lines (later referred to as the lineNumber) in the file.

      On the Compute Engine side, simulating the last empty line is handled in the SourceLinesRepositoryImpl.

      But this implementation is lenient and when the lineNumber is different from the number of lines read from source or this value + 1, we do not fail and only read lineNumber lines from source.

      Consistency of source code with the metadata lineNumber is actually very important (consider other program generating the analysis report in the future) and the CE should better fail with a comprehensive error.

        Attachments

          Activity

            People

            • Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              sebastien.lesaint Sebastien Lesaint
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: