LearnPAd/learnpad

View on GitHub
lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java

Summary

Maintainability
F
1 wk
Test Coverage

File AnnotationEditor.java has 1007 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package gate.creole.ontology.ocat;

import gate.Annotation;
import gate.Factory;
import gate.FeatureMap;

    Method actionPerformed has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        public void actionPerformed(ActionEvent ie) {
          // if(ie.getStateChange() != 1) return;
          if(explicitCall) return;
          if(newAnnotationMode) {
            Object selectedItem = typeCombo.getSelectedItem();

    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 showWindow has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

      private void showWindow() {
    
        // and lets show it
        final JTextArea textComp = ontologyTreePanel.ontoViewer.documentTextArea;
        int x1 = textComp.getSelectionStart();

    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 initGUI has 150 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private void initGUI() {
        annotationWindow =
          new JWindow(
            SwingUtilities
              .getWindowAncestor(ontologyTreePanel.ontoViewer.documentTextualDocumentView

      Method actionPerformed has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

        public void actionPerformed(ActionEvent ae) {
      
          int[] range = ontologyTreePanel.ontoTreeListener.annotationRange;
          int index1 = -1;
          ArrayList<Integer> indexes = new ArrayList<Integer>();

      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 actionPerformed has 119 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void actionPerformed(ActionEvent ie) {
            // if(ie.getStateChange() != 1) return;
            if(explicitCall) return;
            if(newAnnotationMode) {
              Object selectedItem = typeCombo.getSelectedItem();

        Method showWindow has 111 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private void showWindow() {
        
            // and lets show it
            final JTextArea textComp = ontologyTreePanel.ontoViewer.documentTextArea;
            int x1 = textComp.getSelectionStart();

          Method actionPerformed has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

              public void actionPerformed(ActionEvent e) {
                try {
                  if(ontologyTreePanel.ontologyViewerOptions.getDeleteConfirmation()) {
                    Object[] options = new Object[]{"YES", "NO"};
                    int confirm =

          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 actionPerformed has 99 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public void actionPerformed(ActionEvent ae) {
          
              int[] range = ontologyTreePanel.ontoTreeListener.annotationRange;
              int index1 = -1;
              ArrayList<Integer> indexes = new ArrayList<Integer>();

            Method actionPerformed has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void actionPerformed(ActionEvent e) {
                  try {
                    if(ontologyTreePanel.ontologyViewerOptions.getDeleteConfirmation()) {
                      Object[] options = new Object[]{"YES", "NO"};
                      int confirm =

              Method getSimilarAnnotations has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                private ArrayList<Annotation> getSimilarAnnotations(gate.Annotation annot) {
                  ArrayList<Annotation> annotations = new ArrayList<Annotation>();
                  String classValue =
                    Utils
                      .getClassFeatureValue(annot, ontologyTreePanel.ontologyViewerOptions);

              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 getClassesAndInstances has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                private ArrayList<ClassNode> getClassesAndInstances(IFolder rootNode,
                  String startWith) {
              
                  ArrayList<ClassNode> toReturn = new ArrayList<ClassNode>();
              
              

              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 actionPerformed has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public void actionPerformed(ActionEvent e) {
                    try {
                      gate.Annotation annot =
                        ontologyTreePanel.ontoTreeListener.highlightedAnnotations
                          .get(selectedAnnotationIndex);

                Method actionPerformed has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void actionPerformed(ActionEvent e) {
                      try {
                        gate.Annotation annot =
                          ontologyTreePanel.ontoTreeListener.highlightedAnnotations
                            .get(selectedAnnotationIndex);

                  Method getSimilarAnnotations has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    private ArrayList<Annotation> getSimilarAnnotations(gate.Annotation annot) {
                      ArrayList<Annotation> annotations = new ArrayList<Annotation>();
                      String classValue =
                        Utils
                          .getClassFeatureValue(annot, ontologyTreePanel.ontologyViewerOptions);

                    Method actionPerformed has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public void actionPerformed(ActionEvent e) {
                          try {
                    
                            if(!deHighlight.isSelected()) { return; }
                    
                    

                      Method actionPerformed has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public void actionPerformed(ActionEvent e) {
                            gate.Annotation annot =
                              ontologyTreePanel.ontoTreeListener.highlightedAnnotations
                                .get(selectedAnnotationIndex);
                            int startOffset = annot.getStartNode().getOffset().intValue();

                        Method actionPerformed has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public void actionPerformed(ActionEvent e) {
                        
                              gate.Annotation annot =
                                ontologyTreePanel.ontoTreeListener.highlightedAnnotations
                                  .get(selectedAnnotationIndex);

                          Method isValidDomain has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            private boolean isValidDomain(RDFProperty aProp, OInstance inst) {
                              Set<OResource> domain = aProp.getDomain();
                              if(domain == null || domain.isEmpty()) return true;
                              ClassNode inode = ontologyTreePanel.getFirstNode(inst.getName());
                              for(OResource res : domain) {

                          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 isValidRange has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            private boolean isValidRange(RDFProperty aProp, OInstance inst) {
                              Set<OResource> range = aProp.getRange();
                              if(range == null || range.isEmpty()) return true;
                              ClassNode inode = ontologyTreePanel.getFirstNode(inst.getName());
                              for(OResource res : range) {

                          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

                          Avoid deeply nested control flow statements.
                          Open

                                          for(int i = 0; i < annotations.size(); i++) {
                                            ontologyTreePanel.deleteAnnotation(annotations.get(i));
                                          }

                            Method getInstances has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              private Set<OInstance> getInstances(IFolder rootNode) {
                                Set<OInstance> toReturn = new HashSet<OInstance>();
                                if(rootNode instanceof ClassNode
                                  && ((ClassNode)rootNode).getSource() instanceof OInstance) {
                                  if(ontologyTreePanel.ontologyViewerOptions

                            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

                            Avoid too many return statements within this method.
                            Open

                                    return;

                              Avoid too many return statements within this method.
                              Open

                                        return;

                                Avoid too many return statements within this method.
                                Open

                                          return;

                                  Method hasChild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    private boolean hasChild(ClassNode parent, ClassNode child) {
                                      if(parent == child) return true;
                                      if(parent.getChildCount() == 0) return false;
                                      Iterator iter = parent.getChildren();
                                      while(iter.hasNext()) {

                                  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 actionPerformed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public void actionPerformed(ActionEvent e) {
                                        try {
                                  
                                          if(!deHighlight.isSelected()) { return; }
                                  
                                  

                                  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

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                        try {
                                          gate.Annotation annot =
                                            ontologyTreePanel.ontoTreeListener.highlightedAnnotations
                                              .get(selectedAnnotationIndex);
                                          int startOffset = annot.getStartNode().getOffset().intValue();
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 852..884

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 219.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      public void actionPerformed(ActionEvent e) {
                                  
                                        gate.Annotation annot =
                                          ontologyTreePanel.ontoTreeListener.highlightedAnnotations
                                            .get(selectedAnnotationIndex);
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 895..927

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 219.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    private boolean isValidDomain(RDFProperty aProp, OInstance inst) {
                                      Set<OResource> domain = aProp.getDomain();
                                      if(domain == null || domain.isEmpty()) return true;
                                      ClassNode inode = ontologyTreePanel.getFirstNode(inst.getName());
                                      for(OResource res : domain) {
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 617..629

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 111.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    private boolean isValidRange(RDFProperty aProp, OInstance inst) {
                                      Set<OResource> range = aProp.getRange();
                                      if(range == null || range.isEmpty()) return true;
                                      ClassNode inode = ontologyTreePanel.getFirstNode(inst.getName());
                                      for(OResource res : range) {
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 593..604

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 111.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                              if(annot != null) {
                                                if(applyToAll.isSelected()) {
                                                  ArrayList<Annotation> annotations =
                                                    getSimilarAnnotations(annot);
                                                  for(int i = 0; i < annotations.size(); i++) {
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 727..737

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 72.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                            if(annot != null) {
                                              if(applyToAll.isSelected()) {
                                                ArrayList<Annotation> annotations = getSimilarAnnotations(annot);
                                                for(int i = 0; i < annotations.size(); i++) {
                                                  ontologyTreePanel.deleteAnnotation(annotations.get(i));
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 707..718

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 72.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if(isNewAnnotationMode) {
                                        deleteBtn.setEnabled(false);
                                        soelBtn.setEnabled(false);
                                        soerBtn.setEnabled(false);
                                        eoelBtn.setEnabled(false);
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 323..331

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 58.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      else {
                                        deleteBtn.setEnabled(true);
                                        soelBtn.setEnabled(true);
                                        soerBtn.setEnabled(true);
                                        eoelBtn.setEnabled(true);
                                  lp-ontology-recommender/src/main/resources/gate/plugins/Ontology_Tools/src/gate/creole/ontology/ocat/AnnotationEditor.java on lines 314..322

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 58.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  There are no issues that match your filters.

                                  Category
                                  Status