jqassistant

Analyze Java loops in jQAssistant


I would like to create a constraint that looks for database calls made inside Java loops (while, for, lambda) and their related code sections. Mainly to optimize the performance of the application in question.

As of my observations, the graph model does not yet contain details about loops. Have I missed a detail? No: Is there any way to add the needed information? No: Can I fulfill my wish in another way?


Solution

  • The bytecode scanner of jQA does not gather information about loops in the bytecode, mainly for these reasons:

    At this time I do not see a way of simply adding this information to the graph...

    Lambdas can be identified using the concept java:LambdaMethod (see http://jqassistant.github.io/jqassistant/doc/1.10.0/manual/index.html#java:LambdaMethod) but I doubt that using a constraint to check if database calls are made within a lambda without having a check for a surrounding forEach is meaningful. Note that the situation could become different with a source code scanner (currently being worked on as prototype).