GeoKnow/Jassa-Core

View on GitHub
demo/facet-typeahead-odple/facet-typeahead.js

Summary

Maintainability
F
1 wk
Test Coverage

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

                    pre: function(scope, elem, attrs) {
    
                        var modelExpr = $parse(modelExprStr);
                        var pathExpr = $parse(pathExprStr);
                        var configExpr = $parse(configExprStr);
    Severity: Minor
    Found in demo/facet-typeahead-odple/facet-typeahead.js - About 1 hr to fix

      Function getSuggestions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          FacetTypeAheadServiceAngular.prototype.getSuggestions = function(filterString) {
              var config = this.configExpr(this.$scope);
      
              //var sparqlService = config.sparqlService;
      
      
      Severity: Minor
      Found in demo/facet-typeahead-odple/facet-typeahead.js - About 1 hr to fix

        Function createConstraints has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var createConstraints = function(idToModelPathMapping, searchFn, selectionOnly) {
        
                var result = [];
                var keys = Object.keys(idToModelPathMapping);
                keys.forEach(function(key) {
        Severity: Minor
        Found in demo/facet-typeahead-odple/facet-typeahead.js - About 1 hr to fix

          Function makeListService has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var makeListService = function(lsSpec, ftac) {
                  var result;
          
                  if(!lsSpec) {
                      throw new Error('No specification for building a list service provided');
          Severity: Minor
          Found in demo/facet-typeahead-odple/facet-typeahead.js - About 1 hr to fix

            Function FacetTypeAheadServiceAngular has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                var FacetTypeAheadServiceAngular = function($scope, $q, configExpr, id, listServiceExpr) {
            Severity: Minor
            Found in demo/facet-typeahead-odple/facet-typeahead.js - About 35 mins to fix

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

                  return {
                      restrict: 'A',
                      scope: true,
                      //require: 'ngModel',
                      // We need to run this directive before the the ui-bootstrap's type-ahead directive!
              Severity: Major
              Found in demo/facet-typeahead-odple/facet-typeahead.js and 1 other location - About 3 days to fix
              demo/facet-typeahead/facet-typeahead.js on lines 172..277

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

              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

                  FacetTypeAheadServiceAngular.prototype.getSuggestions = function(filterString) {
                      var config = this.configExpr(this.$scope);
              
                      //var sparqlService = config.sparqlService;
              
              
              Severity: Major
              Found in demo/facet-typeahead-odple/facet-typeahead.js and 1 other location - About 2 days to fix
              demo/facet-typeahead/facet-typeahead.js on lines 105..169

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

              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

                  var makeListService = function(lsSpec, ftac) {
                      var result;
              
                      if(!lsSpec) {
                          throw new Error('No specification for building a list service provided');
              Severity: Major
              Found in demo/facet-typeahead-odple/facet-typeahead.js and 1 other location - About 1 day to fix
              demo/facet-typeahead/facet-typeahead.js on lines 18..50

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

              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

                  var FacetTypeAheadServiceAngular = function($scope, $q, configExpr, id, listServiceExpr) {
                      this.$scope = $scope;
                      this.$q = $q;
              
                      this.configExpr = configExpr;
              Severity: Major
              Found in demo/facet-typeahead-odple/facet-typeahead.js and 1 other location - About 1 hr to fix
              demo/facet-typeahead/facet-typeahead.js on lines 96..103

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 72.

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

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

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

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

              Refactorings

              Further Reading

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

                          if(!selectionOnly && Object.prototype.toString.call(val) === '[object String]' && (valStr = val.trim()) !== '') {
              
                              if(searchFn) {
                                  var concept = searchFn(valStr);
                                  r = new jassa.facete.ConstraintConcept(path, concept);
              Severity: Major
              Found in demo/facet-typeahead-odple/facet-typeahead.js and 1 other location - About 1 hr to fix
              demo/facet-typeahead/facet-typeahead.js on lines 67..84

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

              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

                  var parsePathSpec = function(pathSpec) {
                      var result = pathSpec instanceof facete.Path ? pathSpec : facete.Path.parse(pathSpec);
                      return result;
                  };
              Severity: Minor
              Found in demo/facet-typeahead-odple/facet-typeahead.js and 1 other location - About 40 mins to fix
              demo/facet-typeahead/facet-typeahead.js on lines 13..16

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

              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