lib/timeline/component/graph2d_types/line.js

Summary

Maintainability
C
1 day
Test Coverage

Function _catmullRom has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

Line._catmullRom = function (data, group) {
    var alpha = group.options.interpolation.alpha;
    if (alpha == 0 || alpha === undefined) {
        return this._catmullRomUniform(data);
    }
Severity: Minor
Found in lib/timeline/component/graph2d_types/line.js - About 3 hrs 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 _catmullRom has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Line._catmullRom = function (data, group) {
    var alpha = group.options.interpolation.alpha;
    if (alpha == 0 || alpha === undefined) {
        return this._catmullRomUniform(data);
    }
Severity: Major
Found in lib/timeline/component/graph2d_types/line.js - About 2 hrs to fix

    Function drawIcon has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Line.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {
        var fillHeight = iconHeight * 0.5;
        var path, fillPath;
    
        var outline = DOMutil.getSVGElement("rect", framework.svgElements, framework.svg);
    Severity: Minor
    Found in lib/timeline/component/graph2d_types/line.js - About 1 hr to fix

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

      Line.drawShading = function (pathArray, group, subPathArray, framework) {
          // append shading to the path
          if (group.options.shaded.enabled == true) {
              var svgHeight = Number(framework.svg.style.height.replace('px',''));
              var fillPath = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);
      Severity: Minor
      Found in lib/timeline/component/graph2d_types/line.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

      Line.drawShading = function (pathArray, group, subPathArray, framework) {
          // append shading to the path
          if (group.options.shaded.enabled == true) {
              var svgHeight = Number(framework.svg.style.height.replace('px',''));
              var fillPath = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);
      Severity: Minor
      Found in lib/timeline/component/graph2d_types/line.js - About 1 hr to fix

        Function drawIcon has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        Line.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {
            var fillHeight = iconHeight * 0.5;
            var path, fillPath;
        
            var outline = DOMutil.getSVGElement("rect", framework.svgElements, framework.svg);
        Severity: Minor
        Found in lib/timeline/component/graph2d_types/line.js - About 55 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 drawIcon has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        Line.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {
        Severity: Minor
        Found in lib/timeline/component/graph2d_types/line.js - About 45 mins to fix

          Function serializePath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          Line.serializePath = function(pathArray,type,inverse){
              if (pathArray.length < 2){
                  //Too little data to create a path.
                  return "";
              }
          Severity: Minor
          Found in lib/timeline/component/graph2d_types/line.js - About 35 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 calcPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          Line.calcPath = function (dataset, group) {
              if (dataset != null) {
                  if (dataset.length > 0) {
                      var d = [];
          
          
          Severity: Minor
          Found in lib/timeline/component/graph2d_types/line.js - About 35 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

          TODO found
          Open

           * @param {Object} options   // TODO: Describe options

          There are no issues that match your filters.

          Category
          Status