mongoclient/mongoclient

View on GitHub
client/plugins/flot/jquery.flot.pie.js

Summary

Maintainability
F
6 days
Test Coverage

Function init has 470 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function init(plot) {

        var canvas = null,
            target = null,
            options = null,
Severity: Major
Found in client/plugins/flot/jquery.flot.pie.js - About 2 days to fix

    File jquery.flot.pie.js has 525 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Flot plugin for rendering pie charts.
    
    Copyright (c) 2007-2014 IOLA and Ole Laursen.
    Licensed under the MIT license.
    
    
    Severity: Major
    Found in client/plugins/flot/jquery.flot.pie.js - About 1 day to fix

      Function draw has 175 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function draw(plot, newCtx) {
      
                  if (!target) {
                      return; // if no series were passed
                  }
      Severity: Major
      Found in client/plugins/flot/jquery.flot.pie.js - About 7 hrs to fix

        Function drawPie has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function drawPie() {
        
                        var startAngle = Math.PI * options.series.pie.startAngle;
                        var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
        
        
        Severity: Major
        Found in client/plugins/flot/jquery.flot.pie.js - About 4 hrs to fix

          Function combine has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function combine(data) {
          
                      var total = 0,
                          combined = 0,
                          numCombined = 0,
          Severity: Major
          Found in client/plugins/flot/jquery.flot.pie.js - About 2 hrs to fix

            Function findNearbySlice has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function findNearbySlice(mouseX, mouseY) {
            
                        var slices = plot.getData(),
                            options = plot.getOptions(),
                            radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
            Severity: Major
            Found in client/plugins/flot/jquery.flot.pie.js - About 2 hrs to fix

              Function drawLabels has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              function drawLabels() {
              
                                  var currentAngle = startAngle;
                                  var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
              
              
              Severity: Minor
              Found in client/plugins/flot/jquery.flot.pie.js - About 1 hr to fix

                Function drawLabel has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                    function drawLabel(slice, startAngle, index) {
                
                                        if (slice.data[0][1] == 0) {
                                            return true;
                                        }
                Severity: Minor
                Found in client/plugins/flot/jquery.flot.pie.js - About 1 hr to fix

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

                          plot.hooks.drawOverlay.push(function(plot, octx) {
                              var options = plot.getOptions();
                              if (options.series.pie.show) {
                                  drawOverlay(plot, octx);
                              }
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js and 1 other location - About 1 hr to fix
                  client/plugins/flot/jquery.flot.pie.js on lines 146..151

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 67.

                  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

                          plot.hooks.draw.push(function(plot, newCtx) {
                              var options = plot.getOptions();
                              if (options.series.pie.show) {
                                  draw(plot, newCtx);
                              }
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js and 1 other location - About 1 hr to fix
                  client/plugins/flot/jquery.flot.pie.js on lines 139..144

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

                  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 radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js and 2 other locations - About 1 hr to fix
                  client/plugins/flot/jquery.flot.pie.js on lines 349..349
                  client/plugins/flot/jquery.flot.pie.js on lines 541..541

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

                                  var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js and 2 other locations - About 1 hr to fix
                  client/plugins/flot/jquery.flot.pie.js on lines 349..349
                  client/plugins/flot/jquery.flot.pie.js on lines 731..731

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

                                  var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js and 2 other locations - About 1 hr to fix
                  client/plugins/flot/jquery.flot.pie.js on lines 541..541
                  client/plugins/flot/jquery.flot.pie.js on lines 731..731

                  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

                                              $("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
                                                  .css("opacity", options.series.pie.label.background.opacity)
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js and 1 other location - About 1 hr to fix
                  client/plugins/flot/jquery.flot.js on lines 2817..2817

                  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

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

                                          if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
                                              ctx.restore();
                                              return {
                                                  datapoint: [s.percent, s.data],
                                                  dataIndex: 0,
                  Severity: Minor
                  Found in client/plugins/flot/jquery.flot.pie.js and 1 other location - About 40 mins to fix
                  client/plugins/flot/jquery.flot.pie.js on lines 626..634

                  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

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

                                          if (isPointInPoly(arrPoly, arrPoint)) {
                                              ctx.restore();
                                              return {
                                                  datapoint: [s.percent, s.data],
                                                  dataIndex: 0,
                  Severity: Minor
                  Found in client/plugins/flot/jquery.flot.pie.js and 1 other location - About 40 mins to fix
                  client/plugins/flot/jquery.flot.pie.js on lines 598..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 49.

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

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

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

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

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status