webcol/Calima

View on GitHub
public_/plantillas/inspinia/js/plugins/flot/jquery.flot.pie.js

Summary

Maintainability
F
1 mo
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 public_/plantillas/inspinia/js/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 public_/plantillas/inspinia/js/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 public_/plantillas/inspinia/js/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 public_/plantillas/inspinia/js/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 public_/plantillas/inspinia/js/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 public_/plantillas/inspinia/js/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 public_/plantillas/inspinia/js/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 public_/plantillas/inspinia/js/plugins/flot/jquery.flot.pie.js - About 1 hr to fix

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

                  (function($) {
                  
                      // Maximum redraw attempts when fitting labels within the plot
                  
                      var REDRAW_ATTEMPTS = 10;
                  public_/librerias/flot/jquery.flot.pie.js on lines 58..820

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

                  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