GeoKnow/Jassa-Core

View on GitHub

Showing 406 of 406 total issues

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

        toJson: function() {
            var result = [];
            var steps = this.steps;
            
            for(var i = 0; i < steps.length; ++i) {
Severity: Major
Found in trash/to-port/facete/Path.js and 1 other location - About 3 hrs to fix
lib/facete/Path.js on lines 130..142

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

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

Function createQueryFacet has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    createQueryFacet: function(element, tableMod) {

        if(!element) {
            return null;
        }
Severity: Major
Found in lib/facete/QueryUtils.js - About 2 hrs to fix

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

            this.steps.forEach(function(s) {
                var childStep = s.step;
                var childNode = s.child;
    
                console.log('child:', childStep, childNode);
    Severity: Major
    Found in lib/facete/FacetNode.js and 1 other location - About 2 hrs to fix
    trash/to-port/facete/FacetNode.js on lines 358..374

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

    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

                _.each(this.getSteps(), function(s) {
                    var childStep = s.step;
                    var childNode = s.child;
                    
                    console.log("child:", childStep, childNode);
    Severity: Major
    Found in trash/to-port/facete/FacetNode.js and 1 other location - About 2 hrs to fix
    lib/facete/FacetNode.js on lines 318..334

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

    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

    FacetNode has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

        ns.FacetNode = Class.create({
            initialize: function(varNode, step, parent, root) {
                this.parent = parent;
                this.root = root;
                if(!this.root) {
    Severity: Minor
    Found in trash/to-port/facete/FacetNode.js - About 2 hrs to fix

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

          initialize: function(elements) {
              this.elements = elements ? elements : [];
      
              if(!Array.isArray(this.elements)) {
                  throw new Error(this.classLabel + ' expects a single argument of type array, got [' + arguments.length + '] args; ' + typeof elements + ': ' + elements);
      Severity: Major
      Found in lib/sparql/element/ElementGroup.js and 1 other location - About 2 hrs to fix
      lib/sparql/element/ElementUnion.js on lines 13..20

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

      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

          removeMatch: function(pattern) {
              //var pattern = new Triple(s, p, o);
      
              var removals = [];
              this.triples.forEach(function(triple) {
      Severity: Major
      Found in lib/rdf/talis/GraphTalis.js and 1 other location - About 2 hrs to fix
      lib/rdf/GraphImpl.js on lines 52..64

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

      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

          initialize: function(elements) {
              this.elements = elements ? elements : [];
      
              if(!Array.isArray(this.elements)) {
                  throw new Error(this.classLabel + ' expects a single argument of type array, got [' + arguments.length + '] args; ' + typeof elements + ': ' + elements);
      Severity: Major
      Found in lib/sparql/element/ElementUnion.js and 1 other location - About 2 hrs to fix
      lib/sparql/element/ElementGroup.js on lines 13..20

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

      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

          removeMatch: function(pattern) {
              //var pattern = new Triple(s, p, o);
      
              var removals = [];
              this.triples.forEach(function(triple) {
      Severity: Major
      Found in lib/rdf/GraphImpl.js and 1 other location - About 2 hrs to fix
      lib/rdf/talis/GraphTalis.js on lines 52..64

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

      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

      FacetNode has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      var FacetNode = Class.create({
          initialize: function(varNode, step, parent, root) {
              this.parent = parent;
              this.root = root;
              if(!this.root) {
      Severity: Minor
      Found in lib/facete/FacetNode.js - About 2 hrs to fix

        Function str has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function str(key, holder) {
        
            // Produce a string from holder[key].
        
            var i, // The loop counter.
        Severity: Major
        Found in lib/ext/JSONCanonical.js - About 2 hrs to fix

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

              joinElements: function(separator, elements) {
                  var strs = elements.map(function(element) {
                      return element.toString();
                  });
                  var filtered = strs.filter(function(str) {
          Severity: Major
          Found in lib/sparql/ElementHelpers.js and 1 other location - About 2 hrs to fix
          lib/sparql/ExprHelpers.js on lines 26..35

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

          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

              joinElements: function(separator, elements) {
                  var strs = elements.map(function(element) {
                      return element.toString();
                  });
                  var filtered = strs.filter(function(str) {
          Severity: Major
          Found in lib/sparql/ExprHelpers.js and 1 other location - About 2 hrs to fix
          lib/sparql/ElementHelpers.js on lines 3..12

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

          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

                      forEach(obj, function(v, k) {
                          var isSlot = v && v[attr];
                          if (isSlot) {
                              var slot = new Slot(obj, k, v[attr]);
                              result.push(slot);
          Severity: Major
          Found in lib/sponate/Engine.js and 1 other location - About 2 hrs to fix
          lib/sponate/Engine.js on lines 127..137

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

          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

                      obj.forEach(function(item, index) {
                          var isSlot = item && item[attr];
                          if(isSlot) {
                              var slot = new Slot(obj, index, item[attr]);
                              result.push(slot);
          Severity: Major
          Found in lib/sponate/Engine.js and 1 other location - About 2 hrs to fix
          lib/sponate/Engine.js on lines 141..151

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

          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

          Function compile has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  compile: function(elem, attrs) {
          
                      if(!this.instanceId) {
                          this.instanceId = 0;
                      }
          Severity: Major
          Found in demo/facet-typeahead-odple/facet-typeahead.js - About 2 hrs to fix

            Function compile has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    compile: function(elem, attrs) {
            
                        if(!this.instanceId) {
                            this.instanceId = 0;
                        }
            Severity: Major
            Found in demo/facet-typeahead/facet-typeahead.js - About 2 hrs to fix

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

                        function(d, e) {
                              exp = {};
                              exp.token = 'expression';
                              exp.expressionType = 'aggregate';
                              exp.aggregateType = 'min';
              Severity: Major
              Found in staging/sparql-parser.js and 4 other locations - About 2 hrs to fix
              staging/sparql-parser.js on lines 1706..1716
              staging/sparql-parser.js on lines 1717..1727
              staging/sparql-parser.js on lines 1739..1749
              staging/sparql-parser.js on lines 1754..1764

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

              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

                        function(d, e) {
                              exp = {};
                              exp.token = 'expression';
                              exp.expressionType = 'aggregate';
                              exp.aggregateType = 'sum';
              Severity: Major
              Found in staging/sparql-parser.js and 4 other locations - About 2 hrs to fix
              staging/sparql-parser.js on lines 1706..1716
              staging/sparql-parser.js on lines 1728..1738
              staging/sparql-parser.js on lines 1739..1749
              staging/sparql-parser.js on lines 1754..1764

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

              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

                        function(d, e) {
                              exp = {};
                              exp.token = 'expression'
                              exp.expressionType = 'aggregate'
                              exp.aggregateType = 'max'
              Severity: Major
              Found in staging/sparql-parser.js and 4 other locations - About 2 hrs to fix
              staging/sparql-parser.js on lines 1706..1716
              staging/sparql-parser.js on lines 1717..1727
              staging/sparql-parser.js on lines 1728..1738
              staging/sparql-parser.js on lines 1754..1764

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

              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

              Severity
              Category
              Status
              Source
              Language