Menu

Filtering of check list

2018-10-20
2018-10-23
  • Markus Elfring

    Markus Elfring - 2018-10-20

    The list of available checks can grow. The complete list can be retrieved as a XML file already.
    I imagine that it can occasionally be more helpful to select check data according to specific criteria.
    How do you think about to support filter expressions here?

     
  • Daniel Marjamäki

    give a concrete example?

     
    • Markus Elfring

      Markus Elfring - 2018-10-22

      Examples:

      • I would like to filter the provided data by the attribute “severity”.
      • Which checks do handle pointer analysis?
      • How do you think about the selection of documentation categories?
      • Do you distinguish between errors and “warnings”?
       

      Last edit: Markus Elfring 2018-10-22
  • Daniel Marjamäki

    How do you suggest that a user will do this? Show some example command or something.

     
    • Markus Elfring

      Markus Elfring - 2018-10-22

      How do you think about commands like the following?

      • cppcheck --errorlist --id=returnLocalVariable
      • cppcheck --errorlist --query='severity="error" and msg contains "bounds"'
       

      Last edit: Markus Elfring 2018-10-22
      • Daniel Marjamäki

        cppcheck --errorlist --id=returnLocalVariable

        that is basically like:

        cppcheck --errorlist | grep 'id="returnLocalVariable"'
        

        ?

        cppcheck --errorlist --query='severity="error" and msg contains "bounds"'

        is that almost like:

        cppcheck --errorlist | grep 'severity="error"' | grep 'msg=".*bounds.*" verbose="//'
        

        ?

         
        • Daniel Marjamäki

          I am skeptic that people want to filter the --errorlist output.

           
          • Daniel Marjamäki

            I doubt that users use the --errorlist argument much.

             
            • Markus Elfring

              Markus Elfring - 2018-10-23

              I doubt that users use the --errorlist argument much.

              1. I guess that we do not really know the usage frequency of the provided data from this program interface so far.
              2. I imagine that processing of this information can increase if the involved data formats would be completely documented.
              3. How do you think about to support the import of such information into database tables?
               

              Last edit: Markus Elfring 2018-10-23
        • Markus Elfring

          Markus Elfring - 2018-10-23

          cppcheck --errorlist | grep 'id="returnLocalVariable"'

          Can the specified check identifier be omitted from the corresponding data output?

          cppcheck --errorlist | grep 'severity="error"' | grep 'msg=".bounds."

          How would you like to handle multi-line information with such a filter approach?

           
  • Daniel Marjamäki

    With --enable you can choose what severities to execute. I think xml suppressions could be extended to allow various filters --suppress-xml.

     

    Last edit: Daniel Marjamäki 2018-10-22

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.