Customize Scanyp Queries

Scanyp offers a feature enabling users to probe their code base using Python scripts. This feature is particularly valuable for extracting insightful data about the code to monitor its quality and enhance understanding of its operation.

Scanyp comes with a variety of pre-configured queries that are relevant to areas such as code implementation, design, unit testing, code differentiation, and issues statistics.

Scanyp also allows for the creation of custom queries swiftly. To do this, you can generate a new group of queries to contain your unique queries.


Or insert the query into an existing group.


Or add the rule to an existing group.


Additionally, Scanyp affords the flexibility to rename or delete any existing query.

Query Structure

Regarding the structure of the query, it is defined by a Python function called 'queryfunction' and is designed to return an array as a result. Here's an illustration of what a query looks like:

def queryfunction(application):    methods=[{'method':m,'Maintainability Index':m.MaintainabilityIndex,  'DebtRating':m.DebtRank,'Debt':m.Debt,'LOC':m.NbLinesOfCode}            for m in application.Methods if not m.IsThirdParty and m.MaintainabilityIndex<=30  ]        return methods

>./analyze.sh  /home/myuser/compile_commands.json --identifier MyProject
>./analyze.sh  /home/myuser/compile_commands.json --identifier MyProject