CSNW/d3.compose

View on GitHub

Showing 85 of 85 total issues

Function barHeight has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function barHeight(yValue, yScale, offset, stacked, d, i, j) {
Severity: Major
Found in src/charts/bars.js - About 50 mins to fix

    Function barY has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export function barY(yValue, yScale, offset, stacked, d, i, j) {
    Severity: Major
    Found in src/charts/bars.js - About 50 mins to fix

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

        container.on('mouseenter.' + namespace, function() {
          fn({type: 'mouseenter', position: transform(d3.mouse(this))});
        });
      Severity: Major
      Found in src/compose.js and 2 other locations - About 50 mins to fix
      src/compose.js on lines 264..266
      src/compose.js on lines 267..269

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

      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

        container.on('mousemove.' + namespace, function() {
          fn({type: 'mousemove', position: transform(d3.mouse(this))});
        });
      Severity: Major
      Found in src/compose.js and 2 other locations - About 50 mins to fix
      src/compose.js on lines 261..263
      src/compose.js on lines 264..266

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

      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

        container.on('mouseover.' + namespace, function() {
          fn({type: 'mouseover', position: transform(d3.mouse(this))});
        });
      Severity: Major
      Found in src/compose.js and 2 other locations - About 50 mins to fix
      src/compose.js on lines 261..263
      src/compose.js on lines 267..269

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

      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 toSurround has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function toSurround(description) {
        if (!Array.isArray(description)) {
          description = [layered(description)];
        }
      
      
      Severity: Minor
      Found in src/layout.js - About 45 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 prepare has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export function prepare(selection, props) {
        var xScale = props.xScale.copy();
        var yScale = props.yScale.copy();
      
        if (!xScale.bandwidth && !xScale.rangeBand) {
      Severity: Minor
      Found in src/mixins/xy-values.js - About 45 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 bar0 has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function bar0(yValue, yScale, offset, d, i, j) {
      Severity: Minor
      Found in src/charts/bars.js - About 45 mins to fix

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

              if (y >= 0) {
                previous = grouped[x].pos;
                grouped[x].pos = stackedY = grouped[x].pos + y;
              } else {
        Severity: Minor
        Found in src/charts/bars.js and 1 other location - About 40 mins to fix
        src/charts/bars.js on lines 347..350

        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

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

              } else {
                previous = grouped[x].neg;
                grouped[x].neg = stackedY = grouped[x].neg + y;
              }
        Severity: Minor
        Found in src/charts/bars.js and 1 other location - About 40 mins to fix
        src/charts/bars.js on lines 344..347

        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

        Consider simplifying this complex logical expression.
        Open

              if (!has.top || !has.right || !has.bottom || !has.left || !has.width || !has.height) {
                solved = false;
              }
        Severity: Major
        Found in src/layout.js - About 40 mins to fix

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

            var topEdge = top[top.length - 1] && constraint.eq(top[top.length - 1], 'bottom') || 0;
          Severity: Minor
          Found in src/layout.js and 1 other location - About 40 mins to fix
          src/layout.js on lines 233..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 48.

          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

            var leftEdge = left[left.length - 1] && constraint.eq(left[left.length - 1], 'right') || 0;
          Severity: Minor
          Found in src/layout.js and 1 other location - About 40 mins to fix
          src/layout.js on lines 230..230

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

          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 barX has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          export function barX(xValue, xScale, d, i, j) {
          Severity: Minor
          Found in src/charts/bars.js - About 35 mins to fix

            Function prepareLabel has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export function prepareLabel(element, props, d, i, j) {
            Severity: Minor
            Found in src/charts/labels.js - About 35 mins to fix

              Function getValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              export default function getValue(value, scale, d, i, j) {
              Severity: Minor
              Found in src/helpers/get-value.js - About 35 mins to fix

                Function getTransform has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                export function getTransform(rotation, textAlign, verticalAlign, width, height) {
                Severity: Minor
                Found in src/components/text.js - About 35 mins to fix

                  Function getProps has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  export function getProps(props, element, d, i, j) {
                  Severity: Minor
                  Found in src/charts/labels.js - About 35 mins to fix

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

                    export var drawHorizontalBars = createSeriesDraw({
                      prepare: createPrepare(
                        xyValues.prepare,
                        prepareStackedBars
                      ),
                    Severity: Minor
                    Found in src/charts/bars.js and 1 other location - About 35 mins to fix
                    src/charts/bars.js on lines 23..32

                    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

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

                      allItems.forEach(function(item) {
                        byId[item._id] = item;
                        ordered.push(item._id);
                      });
                    Severity: Minor
                    Found in src/layout.js and 1 other location - About 35 mins to fix
                    src/layout.js on lines 39..42

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language