CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/builder/data/analyses.js

Summary

Maintainability
F
6 days
Test Coverage

File analyses.js has 447 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var _ = require('underscore');
var camshaftReference = require('./camshaft-reference');
var AreaOfInfluenceFormModel = require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/area-of-influence-form-model');
var AggregateIntersectionFormModel = require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/aggregate-intersection-form-model');
var FilterIntersectionFormModel = require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-intersection-form-model');
Severity: Minor
Found in lib/assets/javascripts/builder/data/analyses.js - About 6 hrs to fix

    Function getAnalysesByModalCategory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      getAnalysesByModalCategory: function (category, options) {
        return _.reduce(MAP, function (memo, item, analysisType) {
    
          if (item.modalCategory === category) {
            if (_isAnalysisValidByType(analysisType, options)) {
    Severity: Minor
    Found in lib/assets/javascripts/builder/data/analyses.js - About 1 hr 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 2 locations. Consider refactoring.
    Open

      'convex-hull': {
        title: _t('analyses.convex-hull.title'),
        short_title: _t('analyses.convex-hull.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.group-points.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 1 other location - About 3 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 300..314

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

    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

      'sampling': {
        title: _t('analyses.sampling.title'),
        short_title: _t('analyses.sampling.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/sampling-form-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.sampling.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 1 other location - About 3 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 62..76

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

    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

      'filter-by-node-column': {
        title: _t('analyses.filter-by-node-column.title'),
        short_title: _t('analyses.filter-by-node-column.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-by-node-column'),
        modalTitle: _t('components.modals.add-analysis.option-types.filter-by-node-column.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 1 other location - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 211..224

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

    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

      'kmeans': {
        title: _t('analyses.kmeans.title'),
        short_title: _t('analyses.kmeans.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/kmeans-form-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.kmeans.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 1 other location - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 84..97

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

    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

      'filter-range': {
        title: _t('analyses.filter.title'),
        short_title: _t('analyses.filter.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.filter.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 50..61
    lib/assets/javascripts/builder/data/analyses.js on lines 225..236

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

      'centroid': {
        title: _t('analyses.centroid.title'),
        short_title: _t('analyses.centroid.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/centroid-form-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.centroid.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 105..116
    lib/assets/javascripts/builder/data/analyses.js on lines 225..236

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

      'line-to-single-point': {
        title: _t('analyses.connect-with-lines.title'),
        short_title: _t('analyses.connect-with-lines.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/connect-with-lines-form-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.connect-with-lines.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 50..61
    lib/assets/javascripts/builder/data/analyses.js on lines 105..116

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

      'moran': {
        title: _t('analyses.moran-cluster.title'),
        short_title: _t('analyses.moran-cluster.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/moran-form-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.moran-cluster.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 315..325
    lib/assets/javascripts/builder/data/analyses.js on lines 344..354

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

      'spatial-markov-trend': {
        title: _t('analyses.spatial-markov-trend.title'),
        short_title: _t('analyses.spatial-markov-trend.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/spatial-markov-trend-model'),
        modalTitle: _t('components.modals.add-analysis.option-types.spatial-markov-trend.title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 265..275
    lib/assets/javascripts/builder/data/analyses.js on lines 344..354

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

      'closest': {
        title: _t('editor.layers.analysis-form.find-nearest.workflow-title'),
        short_title: _t('editor.layers.analysis-form.find-nearest.workflow-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/closest-form-model'),
        modalTitle: _t('editor.layers.analysis-form.find-nearest.modal-title'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 2 hrs to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 265..275
    lib/assets/javascripts/builder/data/analyses.js on lines 315..325

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

      'georeference-country': {
        title: _t('analyses.georeference.title'),
        short_title: _t('analyses.georeference.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
        checkIfEnabled: function (options) {
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 117..126
    lib/assets/javascripts/builder/data/analyses.js on lines 127..136
    lib/assets/javascripts/builder/data/analyses.js on lines 167..176
    lib/assets/javascripts/builder/data/analyses.js on lines 177..186
    lib/assets/javascripts/builder/data/analyses.js on lines 187..196

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

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

      'georeference-street-address': {
        title: _t('analyses.georeference.title'),
        short_title: _t('analyses.georeference.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
        checkIfEnabled: function (options) {
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 117..126
    lib/assets/javascripts/builder/data/analyses.js on lines 127..136
    lib/assets/javascripts/builder/data/analyses.js on lines 137..146
    lib/assets/javascripts/builder/data/analyses.js on lines 167..176
    lib/assets/javascripts/builder/data/analyses.js on lines 187..196

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

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

      'georeference-city': {
        title: _t('analyses.georeference.title'),
        short_title: _t('analyses.georeference.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
        checkIfEnabled: function (options) {
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 127..136
    lib/assets/javascripts/builder/data/analyses.js on lines 137..146
    lib/assets/javascripts/builder/data/analyses.js on lines 167..176
    lib/assets/javascripts/builder/data/analyses.js on lines 177..186
    lib/assets/javascripts/builder/data/analyses.js on lines 187..196

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

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

      'georeference-admin-region': {
        title: _t('analyses.georeference.title'),
        short_title: _t('analyses.georeference.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
        checkIfEnabled: function (options) {
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 117..126
    lib/assets/javascripts/builder/data/analyses.js on lines 127..136
    lib/assets/javascripts/builder/data/analyses.js on lines 137..146
    lib/assets/javascripts/builder/data/analyses.js on lines 167..176
    lib/assets/javascripts/builder/data/analyses.js on lines 177..186

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

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

      'georeference-ip-address': {
        title: _t('analyses.georeference.title'),
        short_title: _t('analyses.georeference.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
        checkIfEnabled: function (options) {
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 117..126
    lib/assets/javascripts/builder/data/analyses.js on lines 137..146
    lib/assets/javascripts/builder/data/analyses.js on lines 167..176
    lib/assets/javascripts/builder/data/analyses.js on lines 177..186
    lib/assets/javascripts/builder/data/analyses.js on lines 187..196

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

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

      'georeference-postal-code': {
        title: _t('analyses.georeference.title'),
        short_title: _t('analyses.georeference.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
        checkIfEnabled: function (options) {
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 117..126
    lib/assets/javascripts/builder/data/analyses.js on lines 127..136
    lib/assets/javascripts/builder/data/analyses.js on lines 137..146
    lib/assets/javascripts/builder/data/analyses.js on lines 177..186
    lib/assets/javascripts/builder/data/analyses.js on lines 187..196

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

    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

    var checkIfExternalGeocodingIsEnabled = function (options) {
      if (!options.configModel) throw new Error('configModel is required');
      return isDataServicesReady(options.configModel) && !!options.configModel.dataServiceEnabled('hires_geocoder');
    };
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 369..372
    lib/assets/javascripts/builder/data/analyses.js on lines 374..377

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

    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

    var checkIfInternalGeocodingIsEnabled = function (options) {
      if (!options.configModel) throw new Error('configModel is required');
      return isDataServicesReady(options.configModel) && !!options.configModel.dataServiceEnabled('geocoder_internal');
    };
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 374..377
    lib/assets/javascripts/builder/data/analyses.js on lines 379..382

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

    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

    var checkIfRoutingIsEnabled = function (options) {
      if (!options.configModel) throw new Error('configModel is required');
      return isDataServicesReady(options.configModel) && !!options.configModel.dataServiceEnabled('routing');
    };
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 369..372
    lib/assets/javascripts/builder/data/analyses.js on lines 379..382

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

    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

      'line-source-to-target': {
        title: _t('analyses.connect-with-lines.title'),
        short_title: _t('analyses.connect-with-lines.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/connect-with-lines-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/connect-with-lines.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 1 other location - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 245..252

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

    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

      'line-sequential': {
        title: _t('analyses.connect-with-lines.title'),
        short_title: _t('analyses.connect-with-lines.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/connect-with-lines-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/connect-with-lines.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 1 other location - About 1 hr to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 237..244

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

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

      'concave-hull': {
        title: _t('analyses.concave-hull.title'),
        short_title: _t('analyses.concave-hull.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/group-points.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 24..30
    lib/assets/javascripts/builder/data/analyses.js on lines 31..37
    lib/assets/javascripts/builder/data/analyses.js on lines 98..104
    lib/assets/javascripts/builder/data/analyses.js on lines 147..153
    lib/assets/javascripts/builder/data/analyses.js on lines 337..343

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

      'georeference-long-lat': {
        title: _t('analyses.georeference.title'),
        short_title: _t('analyses.georeference.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/georeference-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/georeference.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 24..30
    lib/assets/javascripts/builder/data/analyses.js on lines 31..37
    lib/assets/javascripts/builder/data/analyses.js on lines 77..83
    lib/assets/javascripts/builder/data/analyses.js on lines 98..104
    lib/assets/javascripts/builder/data/analyses.js on lines 337..343

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

      'bounding-box': {
        title: _t('analyses.bounding-box.title'),
        short_title: _t('analyses.bounding-box.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/group-points.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 31..37
    lib/assets/javascripts/builder/data/analyses.js on lines 77..83
    lib/assets/javascripts/builder/data/analyses.js on lines 98..104
    lib/assets/javascripts/builder/data/analyses.js on lines 147..153
    lib/assets/javascripts/builder/data/analyses.js on lines 337..343

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

      'weighted-centroid': {
        title: _t('analyses.centroid.title'),
        short_title: _t('analyses.centroid.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/centroid-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/centroid.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 24..30
    lib/assets/javascripts/builder/data/analyses.js on lines 31..37
    lib/assets/javascripts/builder/data/analyses.js on lines 77..83
    lib/assets/javascripts/builder/data/analyses.js on lines 98..104
    lib/assets/javascripts/builder/data/analyses.js on lines 147..153

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

      'filter-category': {
        title: _t('analyses.filter.title'),
        short_title: _t('analyses.filter.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/filter.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 24..30
    lib/assets/javascripts/builder/data/analyses.js on lines 31..37
    lib/assets/javascripts/builder/data/analyses.js on lines 77..83
    lib/assets/javascripts/builder/data/analyses.js on lines 147..153
    lib/assets/javascripts/builder/data/analyses.js on lines 337..343

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

      'bounding-circle': {
        title: _t('analyses.bounding-circle.title'),
        short_title: _t('analyses.bounding-circle.short-title'),
        FormModel: require('builder/editor/layers/layer-content-views/analyses/analysis-form-models/group-points-form-model'),
        onboardingTemplate: require('builder/components/onboardings/analysis/analyses/group-points.tpl'),
    Severity: Major
    Found in lib/assets/javascripts/builder/data/analyses.js and 5 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 24..30
    lib/assets/javascripts/builder/data/analyses.js on lines 77..83
    lib/assets/javascripts/builder/data/analyses.js on lines 98..104
    lib/assets/javascripts/builder/data/analyses.js on lines 147..153
    lib/assets/javascripts/builder/data/analyses.js on lines 337..343

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

      'routing-to-layer-all-to-all': {
        title: _t('analyses.routing.title'),
        short_title: _t('analyses.routing.short-title'),
        FormModel: FallbackFormModel,
        checkIfEnabled: function (options) {
    Severity: Minor
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 276..283
    lib/assets/javascripts/builder/data/analyses.js on lines 292..299

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

      'routing-to-single-point': {
        title: _t('analyses.routing.title'),
        short_title: _t('analyses.routing.short-title'),
        FormModel: FallbackFormModel,
        checkIfEnabled: function (options) {
    Severity: Minor
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 276..283
    lib/assets/javascripts/builder/data/analyses.js on lines 284..291

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

      'routing-sequential': {
        title: _t('analyses.routing.title'),
        short_title: _t('analyses.routing.short-title'),
        FormModel: FallbackFormModel,
        checkIfEnabled: function (options) {
    Severity: Minor
    Found in lib/assets/javascripts/builder/data/analyses.js and 2 other locations - About 35 mins to fix
    lib/assets/javascripts/builder/data/analyses.js on lines 284..291
    lib/assets/javascripts/builder/data/analyses.js on lines 292..299

    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

    There are no issues that match your filters.

    Category
    Status