Class ComplexityCounter

java.lang.Object
org.ek9lang.compiler.phase5.ComplexityCounter

class ComplexityCounter extends Object
Designed to give a broad indication of complexity, this is not true pure Cyclometric Complexity. But it works on a region or code structure approach, looking at anything that may contribute to code being harder to read or taking more thought than just a simple sequence of statements. It takes into account boolean expressions, exception blocks and case statement for example.
  • Constructor Details

    • ComplexityCounter

      ComplexityCounter()
  • Method Details

    • push

      public AtomicInteger push()
      Push a zero value on to this stack.
    • push

      public AtomicInteger push(int initialValue)
      Push a zero value on to this stack.
    • peek

      public AtomicInteger peek()
      Take a look at the top of the stack.
    • pop

      public AtomicInteger pop()
      Pop a value of the stack (exception is empty.
    • incrementComplexity

      public void incrementComplexity()
    • incrementComplexity

      public void incrementComplexity(AtomicInteger byValue)
    • incrementComplexity

      public void incrementComplexity(int byValue)
    • isEmpty

      public boolean isEmpty()
      True if stack has no contents.