Code Analysis

Castalia's Code Analysis tools help you to identify the areas of your code which would benefit most from refactoring, and help you get a handle on the general quality of your code.

Castalia Code Analysis Window

In the Code Analysis Window, you can see key metrics for every function in your project:

  • Length: The number of "lines" in the function, or more accurately, the number of code statements in the function.
  • Parameter Count: The number of parameters in the function declaration.
  • If Depth: The maximim depth of nested "if" statements in the function.
  • Cyclomatic Complexity: The minimum number of independent code paths through the function. This is the minimum number of tests that would have to be executed in order to ensure that every line of code in the function is tested.
  • Toxicity: Combines the above metrics to create a single value that quantifies how "toxic" the function is. Values greater than 1.0 are prime candidates for refactoring.

Castalia also includes a quickbar tool that shows the same metrics for the current function right in the code editor.

Castalia quick code metrics
Copyright ©2008 TwoDesk Software Company. All Rights Reserved.