LearnPAd/learnpad

View on GitHub
lp-content-analysis/src/main/webapp/WEB-INF/plugins/Tagger_NP_Chunking/src/mark/chunking/GATEWrapper.java

Summary

Maintainability
C
1 day
Test Coverage

Method execute has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

  public void execute() throws ExecutionException {
    // lets get the AnnotationSet we are using as input. Get either the
    // set the user has asked for or if they haven't specified use the
    // default set
    if(inputASName != null && inputASName.equals("")) inputASName = null;

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method execute has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public void execute() throws ExecutionException {
    // lets get the AnnotationSet we are using as input. Get either the
    // set the user has asked for or if they haven't specified use the
    // default set
    if(inputASName != null && inputASName.equals("")) inputASName = null;

    Avoid deeply nested control flow statements.
    Open

                if(ct.equals("B")) {
                  // if the chunk tag is "B" then we are about to start a
                  // new chunk so record the one that has just finished
                  addAnnotation(outputAS, tokens, start, tIndex - 1);
    
    

      There are no issues that match your filters.

      Category
      Status