Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-505

Add Issue suppression for Apex

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Apex
    • Labels:
      None

      Description

      In SONARSLANG-491, we added an issue suppression mechanism for Slang. We were able to make it work for Scala. Due to technical limitations, issue suppression for Apex is currently not supported.

      The goal of this ticket is exactly to support issue suppressions for Apex, via the SuppressWarnings annotation.

      Technical difficulties:

      • Annotations parameters are currently naively represented as a List<String> in Slang. We therefore have to recover the original value of an annotation Node as a String, feature not available within the Apex converter. Hopefully, annotations in Apex are pretty strict, we can rebuild it by hand.
      • We are relying on annotations TextRange to know which node an annotation refers to. In the Apex converter, the TextRange computation is not precise enough. For example:
        @MyAnnotation('param')
        

        In this code, the end of the range will be the one from the last known children ('param'), meaning that the range is excluding the last parenthesis.
        We can therefore not rely on this range without further work.
         

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              quentin.jaquier Quentin Jaquier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: