KarrLab/test_history_server

View on GitHub
public/static/js/flot-0.8.3/jquery.flot.errorbars.js

Summary

Maintainability
F
5 days
Test Coverage

Function drawSeriesErrors has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function drawSeriesErrors(plot, ctx, s){

        var points = s.datapoints.points,
                ps = s.datapoints.pointsize,
                ax = [s.xaxis, s.yaxis],
Severity: Major
Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js - About 3 hrs to fix

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

        function parseErrors(series, i){
    
            var points = series.datapoints.points;
    
            // read errors from points array
    Severity: Minor
    Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js - About 1 hr to fix

      Function drawError has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax){
      Severity: Major
      Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js - About 1 hr to fix

        Function drawError has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax){
        
                //shadow offset
                y += offset;
                upper += offset;
        Severity: Minor
        Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (y > ax[1].max || y < ax[1].min || upper < ax[0].min || lower > ax[0].max)
                                      continue;
          Severity: Major
          Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (x > ax[0].max || x < ax[0].min || upper < ax[1].min || lower > ax[1].max)
                                        continue;
            Severity: Major
            Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js - About 45 mins to fix

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

                      if (drawUpper) {
                          if (err.upperCap == '-'){
                              if (err.err=='x') drawPath(ctx, [[upper,y - radius],[upper,y + radius]] );
                              else drawPath(ctx, [[x - radius,upper],[x + radius,upper]] );
                          } else if ($.isFunction(err.upperCap)){
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 5 hrs to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 311..319

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

              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

                      if (drawLower) {
                          if (err.lowerCap == '-'){
                              if (err.err=='x') drawPath(ctx, [[lower,y - radius],[lower,y + radius]] );
                              else drawPath(ctx, [[x - radius,lower],[x + radius,lower]] );
                          } else if ($.isFunction(err.lowerCap)){
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 5 hrs to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 301..309

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

              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

                      if (ax[0].p2c(ax[0].max) < ax[0].p2c(ax[0].min)) {
                          invertX = true;
                          var tmp = err[0].lowerCap;
                          err[0].lowerCap = err[0].upperCap;
                          err[0].upperCap = tmp;
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 3 hrs to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 180..185

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

              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

                      if (ax[1].p2c(ax[1].min) < ax[1].p2c(ax[1].max)) {
                          invertY = true;
                          var tmp = err[1].lowerCap;
                          err[1].lowerCap = err[1].upperCap;
                          err[1].upperCap = tmp;
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 3 hrs to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 172..177

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

              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

                      if (errors == 'y' || errors == 'xy') {
                          // lower / upper error
                          if (series.points.yerr.asymmetric) {
                              format.push({ y: true, number: true, required: true });
                              format.push({ y: true, number: true, required: true });
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 3 hrs to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 88..95

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

              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

                      if (errors == 'x' || errors == 'xy') {
                          // lower / upper error
                          if (series.points.xerr.asymmetric) {
                              format.push({ x: true, number: true, required: true });
                              format.push({ x: true, number: true, required: true });
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 3 hrs to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 96..103

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

              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

                                  if (err[e].err == 'x')
                                      if (y > ax[1].max || y < ax[1].min || upper < ax[0].min || lower > ax[0].max)
                                          continue;
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 1 hr to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 212..214

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

              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

                                  if (err[e].err == 'y')
                                      if (x > ax[0].max || x < ax[0].min || upper < ax[1].min || lower > ax[1].max)
                                          continue;
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 1 other location - About 1 hr to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 209..211

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

              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

                              if (eb == 'xy')
                                  if (yerr.asymmetric){
                                      eyl = points[i + 4];
                                      eyu = points[i + 5];
                                  } else eyl = points[i + 4];
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 2 other locations - About 1 hr to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 132..136
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 139..143

              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

                              if (eb == 'xy')
                                  if (yerr.asymmetric) {
                                      eyl = points[i + 3];
                                      eyu = points[i + 4];
                                  } else eyl = points[i + 3];
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 2 other locations - About 1 hr to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 125..129
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 139..143

              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

                      } else if (eb == 'y')
                          if (yerr.asymmetric) {
                              eyl = points[i + 2];
                              eyu = points[i + 3];
                          } else eyl = points[i + 2];
              Severity: Major
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 2 other locations - About 1 hr to fix
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 125..129
              public/static/js/flot-0.8.3/jquery.flot.errorbars.js on lines 132..136

              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

                  function init(plot) {
                      plot.hooks.processRawData.push(processRawData);
                      plot.hooks.draw.push(draw);
                  }
              Severity: Minor
              Found in public/static/js/flot-0.8.3/jquery.flot.errorbars.js and 2 other locations - About 35 mins to fix
              public/static/js/flot-0.8.3/jquery.flot.categories.js on lines 179..182
              public/static/js/flot-0.8.3/jquery.flot.image.js on lines 230..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 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