GeoKnow/Jassa-Core

View on GitHub

Showing 406 of 406 total issues

Function getNsURIPrefix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getNsURIPrefix: function(uri) {
        var result = null;
        var bestNs = null;

        // TODO: forEach can't be used in case a simple dictionary/map is used;
Severity: Minor
Found in lib/rdf/PrefixMappingImpl.js - About 35 mins to fix

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

Function createStepRelationsProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    createStepRelationsProperties: function(facetConfig, pathHead, properties, isNegated) {
        var result = [];

        var path = pathHead.getPath();
        var isInverse = pathHead.isInverse();
Severity: Minor
Found in lib/facete/FacetUtils.js - About 35 mins to fix

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

Function getValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getValue: function(node) {
        var result;
        if(node == null) {
            result = null;
        } else if(node.isUri()) {
Severity: Minor
Found in lib/rdf/NodeUtils.js - About 35 mins to fix

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

Function getConstrainedSteps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getConstrainedSteps: function(path) {
            // console.log("getConstrainedSteps: ", path);
        // checkNotNull(path);

        var tmp = [];
Severity: Minor
Found in lib/facete/ConstraintManager.js - About 35 mins to fix

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

Function getItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

Cache.prototype.getItem = function(key) {

  // retrieve the item from the cache
  var item = this.storage_.get(key);

Severity: Minor
Found in lib/ext/monsur-jscache.js - About 35 mins to fix

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

Function copySubstitute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    copySubstitute: function(expr, binding) {
        var fn = function(node) {

            var result = null;

Severity: Minor
Found in lib/sparql/ExprUtils.js - About 35 mins to fix

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

Function all has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    all: function(promises) {
        var r = Promise.all(promises)
            .cancellable()
            ['catch'](Promise.CancellationError, function(e) {
                promises.forEach(function(promise) {
Severity: Minor
Found in lib/util/PromiseUtils.js - About 35 mins to fix

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

Function addMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    addMap: function(spec) {
        var name = spec.name;
        if(!name) {
            throw new Error('Sponate spec must have a name');
        }
Severity: Minor
Found in lib/sponate/facade/StoreFacade.js - About 35 mins to fix

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

Function createFromTalisRdfJson has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    createFromTalisRdfJson: function(talisJson) {
        if (!talisJson || typeof(talisJson.type) === 'undefined') {
            throw new Error('Invalid node: ' + JSON.stringify(talisJson));
        }

Severity: Minor
Found in lib/rdf/NodeFactory.js - About 35 mins to fix

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

Function createDeferred has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    createDeferred: function(isCancellable) {
        var _resolve;
        var _reject;

        var promise = new Promise(function() {
Severity: Minor
Found in lib/util/PromiseUtils.js - About 35 mins to fix

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

        initialize: function(baseFlow, facetTreeConfig, path) {
            this.baseFlow = baseFlow;
            this.facetTreeConfig = facetTreeConfig;
            this.path = path;
        },
Severity: Major
Found in trash/to-port/facete/services/FacetValueFetcher.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9

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

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

    initialize : function(obj, attr, meta) {
        this.obj = obj;
        this.attr = attr;

        this.meta = meta;
Severity: Major
Found in lib/util/Slot.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(simplify, elementFactories, forceGroup) {
        this.simplify = simplify;
        this.elementFactories = elementFactories;
        this.forceGroup = forceGroup;
    },
Severity: Major
Found in lib/sparql/element_factory/ElementFactoryCombine.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(element, sourceVar, targetVar) {
        this.element = element;
        this.sourceVar = sourceVar;
        this.targetVar = targetVar;
    },
Severity: Major
Found in lib/sparql/Relation.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(joinBuilder, alias, targetJoinVars) {
        this.joinBuilder = joinBuilder;
        this.alias = alias;
        this.targetJoinVars = targetJoinVars;
    },
Severity: Major
Found in lib/sparql/join/JoinNode.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(withNode, usingNodes, usingNamedNodes) {
        this.withNode = withNode;
        this.usingNodes = usingNodes;
        this.usingNamedNodes = usingNamedNodes;
    },
Severity: Major
Found in lib/sparql/update/UpdateWithUsing.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(sourceVar, defaultRelation, propertyToRelation) {
        this.sourceVar = sourceVar;
        this.defaultRelation = defaultRelation;
        this.propertyToRelation = propertyToRelation;
    },
Severity: Major
Found in lib/facete/FacetRelationIndex.js and 13 other locations - About 35 mins to fix
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(queryExecution, cacheKey, requestCache) {
        this.queryExecution = queryExecution;

        this.cacheKey = cacheKey;
        this.requestCache = requestCache;
Severity: Major
Found in lib/service/query_execution/QueryExecutionCache.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(expr, pattern, flags) {
        this.expr = expr;
        this.pattern = pattern;
        this.flags = flags;
    },
Severity: Major
Found in lib/sparql/expr/E_Regex.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/facete/FacetValueServiceBuilder.js on lines 18..22
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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

    initialize: function(facetValueService, sparqlService, facetConfig) {
        this.facetValueService = facetValueService;
        this.sparqlService = sparqlService;
        this.facetConfig = facetConfig;
    },
Severity: Major
Found in lib/facete/FacetValueServiceBuilder.js and 13 other locations - About 35 mins to fix
lib/facete/FacetRelationIndex.js on lines 4..8
lib/geo/BboxExprFactoryWkt.js on lines 7..11
lib/service/ListFilter.js on lines 4..8
lib/service/lookup_service/LookupServiceSparqlQuery.js on lines 17..21
lib/service/query_execution/QueryExecutionCache.js on lines 15..21
lib/service/query_execution/QueryExecutionCacheOld.js on lines 14..20
lib/sparql/Relation.js on lines 12..16
lib/sparql/element_factory/ElementFactoryCombine.js on lines 19..23
lib/sparql/expr/E_Regex.js on lines 6..10
lib/sparql/join/JoinNode.js on lines 7..11
lib/sparql/update/UpdateWithUsing.js on lines 4..8
lib/util/Slot.js on lines 4..9
trash/to-port/facete/services/FacetValueFetcher.js on lines 4..8

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

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