christabor/flask_jsondash

View on GitHub
flask_jsondash/static/js/handlers.js

Summary

Maintainability
F
5 days
Test Coverage

File handlers.js has 762 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** global: jsondash */
/** global: c3 */
/** global: d3 */
/** global: venn */
/** global: Plotly */
Severity: Major
Found in flask_jsondash/static/js/handlers.js - About 1 day to fix

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

    jsondash.handlers.handleC3 = function(container, config) {
        var _width = isNaN(config.width) ? jsondash.getDynamicWidth(container, config) : config.width;
        'use strict';
        var init_config = {
            bindto: '[data-guid="' + config.guid + '"] .chart-container',
    Severity: Major
    Found in flask_jsondash/static/js/handlers.js - About 2 hrs to fix

      Function handleTreemap has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jsondash.handlers.handleTreemap = function(container, config) {
          'use strict';
          // Adapted from http://bl.ocks.org/mbostock/4063582
          var margin = {
              top: jsondash.config.WIDGET_MARGIN_Y / 2,
      Severity: Major
      Found in flask_jsondash/static/js/handlers.js - About 2 hrs to fix

        Function handleNumbersGroup has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jsondash.handlers.handleNumbersGroup = function(container, config) {
            'use strict';
            var scale = d3.scale.linear()
                .clamp(true)
                .domain([1, 20]) // min/max digits length
        Severity: Minor
        Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

          Function handleWordCloud has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jsondash.handlers.handleWordCloud = function(container, config) {
              'use strict';
              jsondash.getJSON(container, config, function(error, data){
                  var h     = config.height - jsondash.config.WIDGET_MARGIN_Y;
                  var w     = config.width - jsondash.config.WIDGET_MARGIN_X;
          Severity: Minor
          Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

            Function handleDendrogram has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jsondash.handlers.handleDendrogram = function(container, config) {
                'use strict';
                var _width = isNaN(config.width) ? jsondash.getDynamicWidth(container, config) : config.width;
                // A general padding for the svg inside of the widget.
                // The cluster dendrogram will also need to have padding itself, so
            Severity: Minor
            Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

              Function handleRadialDendrogram has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jsondash.handlers.handleRadialDendrogram = function(container, config) {
                  'use strict';
                  // Code taken (and refactored for use here) from:
                  // https://bl.ocks.org/mbostock/4339607
                  var _width = isNaN(config.width) ? jsondash.getDynamicWidth(container, config) : config.width;
              Severity: Minor
              Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

                Function handleSingleNum has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                jsondash.handlers.handleSingleNum = function(container, config) {
                    'use strict';
                    jsondash.getJSON(container, config, function(error, res){
                        var data = res.data.data ? res.data.data : res.data;
                        var num = container
                Severity: Minor
                Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

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

                  jsondash.handlers.handleCirclePack = function(container, config) {
                      'use strict';
                      // Adapted from https://bl.ocks.org/mbostock/4063530
                      var margin = jsondash.config.WIDGET_MARGIN_Y;
                      var diameter = jsondash.getDiameter(container, config) - margin;
                  Severity: Minor
                  Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

                    Function handleVoronoi has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    jsondash.handlers.handleVoronoi = function(container, config) {
                        'use strict';
                        jsondash.getJSON(container, config, function(error, data){
                            var _width   = isNaN(config.width) ? jsondash.getDynamicWidth(container, config) : config.width;
                            var width    = _width - jsondash.config.WIDGET_MARGIN_X;
                    Severity: Minor
                    Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

                      Function handlePlotly has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      jsondash.handlers.handlePlotly = function(container, config) {
                          'use strict';
                          var id = 'plotly-' + config.guid;
                          var _width = isNaN(config.width) ? jsondash.getDynamicWidth(container, config) : config.width;
                          container
                      Severity: Minor
                      Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

                        Function handleVegaLite has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        jsondash.handlers.handleVegaLite = function(container, config) {
                            'use strict';
                            jsondash.getJSON(container, config, function(error, vlspec){
                                var SCALE_FACTOR = 0.7; // very important to get sizing jusst right.
                                var selector = '[data-guid="' + config.guid + '"] .chart-container';
                        Severity: Minor
                        Found in flask_jsondash/static/js/handlers.js - About 1 hr to fix

                          Avoid too many return statements within this function.
                          Open

                              if(config.type === 'youtube') { return jsondash.handlers.handleYoutube(container, config); }
                          Severity: Major
                          Found in flask_jsondash/static/js/handlers.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                if(config.type === 'custom') { return jsondash.handlers.handleCustom(container, config); }
                            Severity: Major
                            Found in flask_jsondash/static/js/handlers.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  if(config.type === 'circlepack') { return jsondash.handlers.handleCirclePack(container, config); }
                              Severity: Major
                              Found in flask_jsondash/static/js/handlers.js - About 30 mins to fix

                                Function handleC3 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                jsondash.handlers.handleC3 = function(container, config) {
                                    var _width = isNaN(config.width) ? jsondash.getDynamicWidth(container, config) : config.width;
                                    'use strict';
                                    var init_config = {
                                        bindto: '[data-guid="' + config.guid + '"] .chart-container',
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js - About 25 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 handleBasic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                jsondash.handlers.handleBasic = function(container, config) {
                                    'use strict';
                                    if(config.type === 'numbergroup') { return jsondash.handlers.handleNumbersGroup(container, config); }
                                    if(config.type === 'number') { return jsondash.handlers.handleSingleNum(container, config); }
                                    if(config.type === 'iframe') { return jsondash.handlers.handleIframe(container, config); }
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js - About 25 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 handleSingleNum has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                jsondash.handlers.handleSingleNum = function(container, config) {
                                    'use strict';
                                    jsondash.getJSON(container, config, function(error, res){
                                        var data = res.data.data ? res.data.data : res.data;
                                        var num = container
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js - About 25 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 3 locations. Consider refactoring.
                                Open

                                    var svg = container
                                        .select('.chart-container')
                                        .append('svg')
                                        .classed(jsondash.util.getCSSClasses(config))
                                        .attr('width', radius)
                                Severity: Major
                                Found in flask_jsondash/static/js/handlers.js and 2 other locations - About 1 hr to fix
                                flask_jsondash/static/js/handlers.js on lines 590..595
                                flask_jsondash/static/js/handlers.js on lines 635..640

                                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 svg = container
                                            .select('.chart-container')
                                            .append('svg')
                                            .classed(jsondash.util.getCSSClasses(config))
                                            .attr('width', width)
                                Severity: Major
                                Found in flask_jsondash/static/js/handlers.js and 2 other locations - About 1 hr to fix
                                flask_jsondash/static/js/handlers.js on lines 540..545
                                flask_jsondash/static/js/handlers.js on lines 590..595

                                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 svg = container
                                        .select('.chart-container')
                                        .append('svg')
                                        .classed(jsondash.util.getCSSClasses(config))
                                        .attr('width', width)
                                Severity: Major
                                Found in flask_jsondash/static/js/handlers.js and 2 other locations - About 1 hr to fix
                                flask_jsondash/static/js/handlers.js on lines 540..545
                                flask_jsondash/static/js/handlers.js on lines 635..640

                                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

                                    container
                                        .select('.chart-container')
                                        .append('iframe')
                                        .classed(jsondash.util.getCSSClasses(config))
                                        .attr('width', width)
                                Severity: Major
                                Found in flask_jsondash/static/js/handlers.js and 1 other location - About 1 hr to fix
                                flask_jsondash/static/js/handlers.js on lines 431..437

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

                                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

                                    var svg = container
                                        .select('.chart-container')
                                        .append('svg')
                                        .classed(jsondash.util.getCSSClasses(config))
                                        .attr('width', diameter)
                                Severity: Major
                                Found in flask_jsondash/static/js/handlers.js and 1 other location - About 1 hr to fix
                                flask_jsondash/static/js/handlers.js on lines 227..233

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

                                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

                                        var svg   = container
                                            .select('.chart-container')
                                            .append('svg')
                                            .classed(jsondash.util.getCSSClasses(config))
                                            .classed({'wordcloud': true});
                                Severity: Major
                                Found in flask_jsondash/static/js/handlers.js and 1 other location - About 1 hr to fix
                                flask_jsondash/static/js/handlers.js on lines 250..254

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

                                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

                                        var svg = container
                                            .select('.chart-container')
                                            .append('svg')
                                            .classed(jsondash.util.getCSSClasses(config))
                                            .classed({'chart-graph': true});
                                Severity: Major
                                Found in flask_jsondash/static/js/handlers.js and 1 other location - About 1 hr to fix
                                flask_jsondash/static/js/handlers.js on lines 278..282

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

                                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

                                    var scale = d3.scale.linear()
                                        .clamp(true)
                                        .domain([1, 20]) // min/max digits length
                                        .range([80, 30]); // max/min font-size
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js and 1 other location - About 50 mins to fix
                                flask_jsondash/static/js/utils.js on lines 176..179

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

                                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

                                        var node = div.datum(root).selectAll('.node')
                                            .data(treemap.nodes)
                                            .enter().append('div')
                                            .attr('class', 'node')
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js and 1 other location - About 40 mins to fix
                                flask_jsondash/static/js/handlers.js on lines 440..443

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 49.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        var node = svg.datum(data).selectAll('.node')
                                        .data(pack.nodes)
                                        .enter().append('g')
                                        .attr('class', function(d) { return d.children ? 'node' : 'leaf node'; })
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js and 1 other location - About 40 mins to fix
                                flask_jsondash/static/js/handlers.js on lines 490..493

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 49.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        var node = g.selectAll('.node')
                                        .data(nodes)
                                        .enter().append('g')
                                        .attr('class', 'node')
                                        .attr('transform', function(d) { return 'translate(' + d.y + ',' + d.x + ')'; });
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js and 2 other locations - About 35 mins to fix
                                flask_jsondash/static/js/handlers.js on lines 557..561
                                flask_jsondash/static/js/handlers.js on lines 602..606

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

                                        var link = g.selectAll('.link')
                                        .data(links)
                                        .enter().append('path')
                                        .attr('class', 'link')
                                        .attr('d', diagonal);
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js and 2 other locations - About 35 mins to fix
                                flask_jsondash/static/js/handlers.js on lines 557..561
                                flask_jsondash/static/js/handlers.js on lines 608..612

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

                                        var node = g.selectAll('g.node')
                                            .data(nodes)
                                            .enter().append('g')
                                            .attr('class', 'node')
                                            .attr('transform', function(d) { return 'rotate(' + (d.x - 90) + ')translate(' + d.y + ')'; });
                                Severity: Minor
                                Found in flask_jsondash/static/js/handlers.js and 2 other locations - About 35 mins to fix
                                flask_jsondash/static/js/handlers.js on lines 602..606
                                flask_jsondash/static/js/handlers.js on lines 608..612

                                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

                                There are no issues that match your filters.

                                Category
                                Status