Skip to content

Minor changes to structural analysis of methods#4

Merged
fernandoop merged 13 commits intocodeemoji:mainfrom
mpenduzzu:main
Apr 30, 2024
Merged

Minor changes to structural analysis of methods#4
fernandoop merged 13 commits intocodeemoji:mainfrom
mpenduzzu:main

Conversation

@mpenduzzu
Copy link
Contributor

@mpenduzzu mpenduzzu commented Apr 29, 2024

This pull request contains changes for the structural analysis of methods. It mainly incorporates small error fixes, minor configuration changes for some scenarios, refactoring modifications and a correspondingly updated documentation. The most notable alterations done to the previous plugin version include:

  1. Fixes → Some scenarios have been refined to properly activate the corresponding inlay hints in some particular situations:

    • The CEUtils class now implements methods for counting the number of lines in a method body. These are invoked by the HighCyclomaticComplexityMethod and LargeLineCountMethod classes in order to perform their respective computations using a methodology that now foresees the calculation of the line count inside a method's body with the added possibility of excluding superfluous comment lines from it.
  2. Configuration changes for some scenarios → Some scenarios can now be configured in more detail:

    • Users can set up individual thresholds for the code complexity and the overall line count of the method body to precisely regulate when the inlay hint for methods having a high cyclomatic complexity per line should be shown (see configuration example).
    • Users can decide to exclude comments from the calculation of the lines present within the body of a method having a large line count (see configuration example).
  3. Refactoring → The code for some scenarios has been refactored to accomodate the changes mentioned above and to improve the activation performance of the corresponding inlay hints:

    • The logic for the activation of some Inlay Hints was optimized to adhere to some of the guidelines mentioned in the documentation for the "IntelliJ Platform Plugin SDK". The modifications introduced to do so were made to minimize the invocation of expensive methods of the PSIElement class and to avoid unnecessary repeated resolutions of method calls. The latter motivation could potentially be enforced even further by implementing a caching mechanism for storing and efficiently reusing values that are of interest to the scenario being analyzed. This could constitute an interesting development topic once new cases for the structural analysis of source code will be added to the plugin.

@fernandoop fernandoop merged commit 66a5430 into codeemoji:main Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants