LearnPAd/learnpad

View on GitHub
lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java

Summary

Maintainability
F
2 wks
Test Coverage

File AbstractOntologyImpl.java has 1348 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 *  Copyright (c) 1995-2012, The University of Sheffield. See the file
 *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
 *
 *  This file is part of GATE (see http://gate.ac.uk/), and is free

    AbstractOntologyImpl has 110 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public abstract class AbstractOntologyImpl
        extends AbstractLanguageResource
        implements Ontology {
    
      

      Method resolveImports has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
      Open

        public void resolveImports(Map<String, String> importMappings) {
          boolean haveUnresolvedImports = true;
          // make sure we have a map, even if empty
          if (importMappings == null) {
            importMappings = new HashMap<String, String>();

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

        public void resolveImports(Map<String, String> importMappings) {
          boolean haveUnresolvedImports = true;
          // make sure we have a map, even if empty
          if (importMappings == null) {
            importMappings = new HashMap<String, String>();

        Method getDistance has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

          public int getDistance(OClass class1, OClass class2) {
        
            if(!containsOClass(class1.getONodeID())) {
              Utils.warning(class1.getONodeID().toString() + " does not exist");
              return -1;

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

            public ObjectProperty addObjectProperty(OURI aPropertyURI, Set<OClass> domain,
                  Set<OClass> range) {
            if (domain == null) {
              domain = new HashSet<OClass>();
            }

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

          public TransitiveProperty addTransitiveProperty(OURI aPropertyURI,
            Set<OClass> domain, Set<OClass> range) {
            if(domain == null) {
              domain = new HashSet<OClass>();
            }

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

          public TransitiveProperty addTransitiveProperty(OURI aPropertyURI,
            Set<OClass> domain, Set<OClass> range) {
            if(domain == null) {
              domain = new HashSet<OClass>();
            }

          Method addObjectProperty has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public ObjectProperty addObjectProperty(OURI aPropertyURI, Set<OClass> domain,
                    Set<OClass> range) {
              if (domain == null) {
                domain = new HashSet<OClass>();
              }

            Method addSymmetricProperty has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

              public SymmetricProperty addSymmetricProperty(OURI aPropertyURI,
                Set<OClass> domainAndRange) {
                if(domainAndRange == null) {
                  domainAndRange = new HashSet<OClass>();
                }

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

              public List<OResource> getOResourcesWith(RDFProperty aProperty,
                OResource aValue) {
                List<OResource> toReturn = new ArrayList<OResource>();
            
                int propType = 1;

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

              public int getDistance(OClass class1, OClass class2) {
            
                if(!containsOClass(class1.getONodeID())) {
                  Utils.warning(class1.getONodeID().toString() + " does not exist");
                  return -1;

              Method addSymmetricProperty has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public SymmetricProperty addSymmetricProperty(OURI aPropertyURI,
                  Set<OClass> domainAndRange) {
                  if(domainAndRange == null) {
                    domainAndRange = new HashSet<OClass>();
                  }

                Method loadImportMappingsFile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                  public Map<String, String> loadImportMappingsFile(java.net.URL mappingsURL) {
                    Map<String, String> mappings = new HashMap<String, String>();
                    try {
                      // open file and read line by line, each line should have
                      // two tab-separated strings, which will be trimmed and added

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

                  public List<OResource> getOResourcesWith(RDFProperty aProperty, Literal aValue) {
                    List<OResource> toReturn = new ArrayList<OResource>();
                
                    int propType = 1;
                
                

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

                  public DatatypeProperty addDatatypeProperty(OURI aPropertyURI,
                    Set<OClass> domain, DataType aDatatype) {
                    if(domain == null) {
                      domain = new HashSet<OClass>();
                    }

                  Method addDatatypeProperty has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public DatatypeProperty addDatatypeProperty(OURI aPropertyURI,
                      Set<OClass> domain, DataType aDatatype) {
                      if(domain == null) {
                        domain = new HashSet<OClass>();
                      }

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

                    public Map<String, String> loadImportMappingsFile(java.net.URL mappingsURL) {
                      Map<String, String> mappings = new HashMap<String, String>();
                      try {
                        // open file and read line by line, each line should have
                        // two tab-separated strings, which will be trimmed and added

                    Method getOResourcesWith has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public List<OResource> getOResourcesWith(RDFProperty aProperty,
                        OResource aValue) {
                        List<OResource> toReturn = new ArrayList<OResource>();
                    
                        int propType = 1;

                      Method getOResourcesWith has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public List<OResource> getOResourcesWith(RDFProperty aProperty, Literal aValue) {
                          List<OResource> toReturn = new ArrayList<OResource>();
                      
                          int propType = 1;
                      
                      

                        Avoid deeply nested control flow statements.
                        Open

                                    if (mapped != null &&
                                        // !mapped.isEmpty()  - does not work in Java 1.5
                                        (mapped.length() != 0)) {
                                      URL location;
                                      try {

                          Avoid deeply nested control flow statements.
                          Open

                                      if (URIString.startsWith(pattern)) {
                                        //System.out.println("Processing URI: " + URIString);
                                        //System.out.println("Found matching pattern: " + pattern);
                                        // substitute the pattern in the uri with the mapping, or
                                        // ignore the URI if the mapping is empty

                            Avoid deeply nested control flow statements.
                            Open

                                        if(s2.contains(c)) {
                                          result = i1 + i2 + 2;
                                          i1 = supers1.size();
                                          i2 = supers2.size();
                                          break;

                              Method removeOntologyModificationListener has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                public synchronized void removeOntologyModificationListener(
                                  OntologyModificationListener oml) {
                                  if(this.modificationListeners == null
                                    || !this.modificationListeners.contains(oml)) {
                                    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

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

                                public void setOntologyURI(OURI theURI) {
                                  // TODO: check if already have one or more URIs, if yes, remove them(?)
                                  Set<OURI> uris = ontologyService.getOntologyURIs();
                                  if(uris.size() == 0) {
                                    ontologyService.setOntologyURI(theURI);

                              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

                                public TransitiveProperty addTransitiveProperty(OURI aPropertyURI,
                                  Set<OClass> domain, Set<OClass> range) {
                                  if(domain == null) {
                                    domain = new HashSet<OClass>();
                                  }
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 774..837

                              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 466.

                              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 ObjectProperty addObjectProperty(OURI aPropertyURI, Set<OClass> domain,
                                        Set<OClass> range) {
                                  if (domain == null) {
                                    domain = new HashSet<OClass>();
                                  }
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 939..1002

                              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 466.

                              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 MaxCardinalityRestriction addMaxCardinalityRestriction(
                                  RDFProperty onProperty, String maxCardinalityValue)
                                  throws InvalidValueException {
                                  String restId = getAutoGeneratedRestrictionName();
                                  DataType datatype =
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1125..1152

                              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 137.

                              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 MinCardinalityRestriction addMinCardinalityRestriction(
                                  RDFProperty onProperty, String minCardinalityValue)
                                  throws InvalidValueException {
                                  String restId = getAutoGeneratedRestrictionName();
                                  DataType datatype =
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1168..1194

                              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 137.

                              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 4 locations. Consider refactoring.
                              Open

                                public HasValueRestriction addHasValueRestriction(RDFProperty onProperty,
                                  OResource hasValue) {
                              
                                  String restId = getAutoGeneratedRestrictionName();
                              
                              
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1288..1305
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1307..1324
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1337..1354

                              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 89.

                              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 4 locations. Consider refactoring.
                              Open

                                public AllValuesFromRestriction addAllValuesFromRestriction(
                                  ObjectProperty onProperty, OClass hasValue) {
                                  String restId = getAutoGeneratedRestrictionName();
                              
                                  OBNodeID bnode = createOBNodeID(restId);
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1249..1275
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1288..1305
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1337..1354

                              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 89.

                              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 4 locations. Consider refactoring.
                              Open

                                public AllValuesFromRestriction addAllValuesFromRestriction(
                                  RDFProperty onProperty, OResource hasValue) {
                                  String restId = getAutoGeneratedRestrictionName();
                              
                                  OBNodeID bnode = createOBNodeID(restId);
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1249..1275
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1307..1324
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1337..1354

                              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 89.

                              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 4 locations. Consider refactoring.
                              Open

                                public SomeValuesFromRestriction addSomeValuesFromRestriction(
                                  RDFProperty onProperty, OResource hasValue) {
                                  String restId = getAutoGeneratedRestrictionName();
                              
                                  OBNodeID bnode = createOBNodeID(restId);
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1249..1275
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1288..1305
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1307..1324

                              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 89.

                              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 5 locations. Consider refactoring.
                              Open

                                public Set<SymmetricProperty> getSymmetricProperties() {
                                  Property[] properties =
                                    ontologyService.getSymmetricProperties();
                                  Set<SymmetricProperty> set = new HashSet<SymmetricProperty>();
                                  for(int i = 0; i < properties.length; i++) {
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 673..683
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 746..755
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 844..852
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1009..1020

                              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 79.

                              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 5 locations. Consider refactoring.
                              Open

                                public Set<ObjectProperty> getObjectProperties() {
                                  Property[] properties = ontologyService.getObjectProperties();
                                  Set<ObjectProperty> set = new HashSet<ObjectProperty>();
                                  for(int i = 0; i < properties.length; i++) {
                                    set.add((ObjectProperty)Utils.createOProperty(
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 673..683
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 746..755
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 924..933
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1009..1020

                              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 79.

                              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 5 locations. Consider refactoring.
                              Open

                                public Set<TransitiveProperty> getTransitiveProperties() {
                                  Property[] properties =
                                    ontologyService.getTransitiveProperties();
                                  Set<TransitiveProperty> set = new HashSet<TransitiveProperty>();
                                  for(int i = 0; i < properties.length; i++) {
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 673..683
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 746..755
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 844..852
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 924..933

                              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 79.

                              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 5 locations. Consider refactoring.
                              Open

                                public Set<AnnotationProperty> getAnnotationProperties() {
                                  Property[] properties =
                                    ontologyService.getAnnotationProperties();
                                  Set<AnnotationProperty> set = new HashSet<AnnotationProperty>();
                                  for(int i = 0; i < properties.length; i++) {
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 746..755
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 844..852
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 924..933
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1009..1020

                              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 79.

                              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 5 locations. Consider refactoring.
                              Open

                                public Set<DatatypeProperty> getDatatypeProperties() {
                                  Property[] properties =
                                    ontologyService.getDatatypeProperties();
                                  Set<DatatypeProperty> set = new HashSet<DatatypeProperty>();
                                  for(int i = 0; i < properties.length; i++) {
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 673..683
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 844..852
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 924..933
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1009..1020

                              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 79.

                              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

                                            try {
                                              System.out.println("Loading import for " + URIString + " from " + location);
                                              readOntologyData(is, anURI.toString(), OntologyFormat.RDFXML, true);
                                            } catch (Exception ex) {
                                              throw new GateOntologyException(
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1903..1909

                              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

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

                                        try {
                                          System.out.println("Loading import for " + URIString + " from " + location);
                                          readOntologyData(is, anURI.toString(), OntologyFormat.RDFXML, true);
                                        } catch (Exception ex) {
                                          throw new GateOntologyException(
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1835..1841

                              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

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

                                  for(int i2 = 0; i2 < supers2.size(); i2++) {
                                    if(supers2.get(i2).contains(class1)) {
                                      result = i2 + 1;
                                      break;
                                    }
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 347..352

                              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 50.

                              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

                                  for(int i1 = 0; i1 < supers1.size(); i1++) {
                                    if(supers1.get(i1).contains(class2)) {
                                      result = i1 + 1;
                                      break;
                                    }
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 353..358

                              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 50.

                              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 Set<RDFProperty> getPropertyDefinitions() {
                                  Set<RDFProperty> set = new HashSet<RDFProperty>();
                                  set.addAll(getAnnotationProperties());
                                  set.addAll(getDatatypeProperties());
                                  set.addAll(getObjectProperties());
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/OInstanceImpl.java on lines 645..652

                              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 47.

                              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 fireOntologyResourcesRemoved(String[] resources) {
                                  // we need to delete this resource from our maps
                                  //for(int i = 0; i < resources.length; i++) {
                                  //  removeOResourceFromMap(resources[i]);
                                  //}
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1465..1472

                              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 44.

                              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 fireOntologyResourceAdded(OResource resource) {
                                  List<OntologyModificationListener> listeners = this.modificationListeners;
                                  if(listeners != null) {
                                    for(OntologyModificationListener l : listeners) {
                                      l.resourceAdded(this, resource);
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1479..1491

                              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 44.

                              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 3 locations. Consider refactoring.
                              Open

                                public ObjectProperty getObjectProperty(OURI theURI) {
                                  if(ontologyService.isObjectProperty(theURI)) {
                                    return (ObjectProperty) Utils.createOProperty(this,ontologyService,
                                        theURI.toString(), OConstants.OBJECT_PROPERTY);
                                  } else {
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1061..1068
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1069..1076

                              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 40.

                              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 3 locations. Consider refactoring.
                              Open

                                public AnnotationProperty getAnnotationProperty(OURI theURI) {
                                  if(ontologyService.isAnnotationProperty(theURI)) {
                                    return (AnnotationProperty) Utils.createOProperty(this,ontologyService,
                                        theURI.toString(), OConstants.ANNOTATION_PROPERTY);
                                  } else {
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1069..1076
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1077..1084

                              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 40.

                              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 3 locations. Consider refactoring.
                              Open

                                public DatatypeProperty getDatatypeProperty(OURI theURI) {
                                  if(ontologyService.isDatatypeProperty(theURI)) {
                                    return (DatatypeProperty) Utils.createOProperty(this,ontologyService,
                                        theURI.toString(), OConstants.DATATYPE_PROPERTY);
                                  } else {
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1061..1068
                              lp-ontology-recommender/src/main/resources/gate/plugins/Ontology/src/gate/creole/ontology/impl/AbstractOntologyImpl.java on lines 1077..1084

                              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 40.

                              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