Showing 43 of 43 total issues

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

function d3_svg_lineFiniteDifferences(points) {
  var i = 0,
      j = points.length - 1,
      m = [],
      p0 = points[0],
Severity: Major
Found in addon/utils/shadow/line-interpolation/monotone.js and 1 other location - About 5 hrs to fix
addon/utils/shadow/line-interpolation/monotone.js on lines 165..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 142.

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

function d3_svg_lineFiniteDifferences(points) {
  var i = 0,
      j = points.length - 1,
      m = [],
      p0 = points[0],
Severity: Major
Found in addon/utils/shadow/line-interpolation/monotone.js and 1 other location - About 5 hrs to fix
addon/utils/shadow/line-interpolation/monotone.js on lines 151..163

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

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

export function e3ScaleMin(params, options) {
  let [scale] = params;
  let {minus, add} = options;
  if(scale && scale.range) {
    let minValue = min.apply(null, scale.range);
Severity: Major
Found in addon/helpers/e3-scale-min.js and 1 other location - About 3 hrs to fix
addon/helpers/e3-scale-max.js on lines 4..19

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

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

export function e3ScaleMax(params, options = {}) {
  let [scale] = params;
  let {minus, add} = options;
  if(scale && scale.range) {
    let maxValue = max.apply(null, scale.range);
Severity: Major
Found in addon/helpers/e3-scale-max.js and 1 other location - About 3 hrs to fix
addon/helpers/e3-scale-min.js on lines 4..19

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

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

Function e3Extent has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export function e3Extent(params, hash) {
  let arr = params[0];

  if(!arr) {
    return [-Infinity, Infinity];
Severity: Minor
Found in addon/helpers/e3-extent.js - About 2 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 d3_svg_lineHermite has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function d3_svg_lineHermite(points, tangents) {
  if (tangents.length < 1 || (points.length !== tangents.length && points.length !== tangents.length + 2)) {
    return points;
  }

Severity: Major
Found in addon/utils/shadow/line-interpolation/monotone.js - About 2 hrs to fix

    Function e3Extent has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function e3Extent(params, hash) {
      let arr = params[0];
    
      if(!arr) {
        return [-Infinity, Infinity];
    Severity: Major
    Found in addon/helpers/e3-extent.js - About 2 hrs to fix

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

          requiredKeys.forEach((key, index) => {
            let val = attrs.hasOwnProperty(key) ? this.getAttr(key) : get(activeState, key);
            resultState[key] = typeof val === 'function' ? val.call(this, data, index) : val;
          });
      Severity: Major
      Found in addon/mixins/e3-animated-child.js and 1 other location - About 2 hrs to fix
      addon/mixins/e3-animated-child.js on lines 76..79

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

      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

          keys(animation).forEach((key, index) => {
            let val = attrs.hasOwnProperty(key) ? this.getAttr(key) : get(animation, key);
            resultState[key] = typeof val === 'function' ? val.call(this, data, index) : val;
          });
      Severity: Major
      Found in addon/mixins/e3-animated-child.js and 1 other location - About 2 hrs to fix
      addon/mixins/e3-animated-child.js on lines 100..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 76.

      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

        unregister(child) {
          let shadow = get(this, 'shadow');
          if(shadow) {
            get(this, 'shadow').remove(get(child, 'shadow'));
          } else {
      Severity: Major
      Found in addon/components/e3-group.js and 1 other location - About 1 hr to fix
      addon/components/e3-group.js on lines 39..46

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

      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

        register(child) {
          let shadow = get(this, 'shadow');
          if(shadow) {
            get(this, 'shadow').add(get(child, 'shadow'));
          } else {
      Severity: Major
      Found in addon/components/e3-group.js and 1 other location - About 1 hr to fix
      addon/components/e3-group.js on lines 48..55

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

      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

      Function shadowScalesOrdinal has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function shadowScalesOrdinal(range = [0,1], domain = [0,1], options = {}) {
        let {banding, outerPadding, padding, sort} = options;
        let spaceBetween = 0;
        let [r0, r1] = range;
      
      
      Severity: Minor
      Found in addon/utils/shadow/scales/ordinal.js - About 1 hr to fix

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

            commands.push([
              p[0] - t0[0] * 2 / 3,
              p[1] - t0[1] * 2 / 3,
              p[0],
              p[1]
        Severity: Major
        Found in addon/utils/shadow/line-interpolation/monotone.js and 1 other location - About 1 hr to fix
        addon/utils/shadow/line-interpolation/monotone.js on lines 135..140

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

        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

            commands.push([
              p[0] + t[0] * 2 / 3,
              p[1] + t[1] * 2 / 3,
              lp[0],
              lp[1]
        Severity: Major
        Found in addon/utils/shadow/line-interpolation/monotone.js and 1 other location - About 1 hr to fix
        addon/utils/shadow/line-interpolation/monotone.js on lines 93..98

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

        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

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

          processIterableComponent(componentItem, iterableGuids, iterableMap) {
            let {component, children, dataState} = componentItem;
            let {enter, exit, active} = calculateChanges(dataState, iterableGuids);
            let type = this.getType();
            componentItem.dataState = active;
        Severity: Minor
        Found in addon/components/e3-collection.js - About 1 hr to fix

          Function d3_svg_lineMonotoneTangents has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function d3_svg_lineMonotoneTangents(points) {
            var tangents = [],
                d,
                a,
                b,
          Severity: Minor
          Found in addon/utils/shadow/line-interpolation/monotone.js - About 1 hr to fix

            Function generateState has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              generateState(stateName, dataContext = null) {
                let activeState = get(this, 'activeState');
            
                let data = dataContext || this.getDataContext();
                let attrs = this.get('attrs');
            Severity: Minor
            Found in addon/mixins/e3-animated-child.js - About 1 hr to fix

              Function e3BindScale has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              export function e3BindScale(params, options) {
                let {scaleDifference, data:manualData} = options;
                let [scale, key] = params;
              
                if(scale) {
              Severity: Minor
              Found in addon/helpers/e3-bind-scale.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 d3_svg_lineMonotoneTangents has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function d3_svg_lineMonotoneTangents(points) {
                var tangents = [],
                    d,
                    a,
                    b,
              Severity: Minor
              Found in addon/utils/shadow/line-interpolation/monotone.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 range has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function range(start, stop, step) {
                if (arguments.length < 3) {
                  step = 1;
                  if (arguments.length < 2) {
                    stop = start;
              Severity: Minor
              Found in addon/utils/e3-ticks.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

              Severity
              Category
              Status
              Source
              Language