creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

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

        if (((this.elimits[1] - rawdata) / (this.elimits[1] - this.elimits[0])) < 0.05) {
          this.options.plugins.datalabels.align = 'left';
          this.options.plugins.datalabels.color = 'white';
        } else {
          this.options.plugins.datalabels.align = 'right';
Severity: Minor
Found in src/elements/chartjs-barplot.js and 1 other location - About 45 mins to fix
src/elements/chartjs-barplot.js on lines 115..121

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

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

Avoid deeply nested control flow statements.
Open

                                    if (value.y) ctx.fillText(value.y.toPrecision(4),x,y);
Severity: Major
Found in src/elements/chartjs-fixed.js - About 45 mins to fix

    Function constructor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    constructor() {
        super();
        this.handleValueChange = e => {
            //sets data to dataset
            //apply value convert among all data
    Severity: Minor
    Found in src/elements/range-smooth2.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 bind has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        bind() {
          //console.log('button.bind()');
          this.ids2send = this.ids.split(',');
          this.createids = [];
          //create those ids not yet in HTML DOM and put them to createids array
    Severity: Minor
    Found in src/elements/buttonparams.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

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

            if (ret.length > 0 && fields[0] < ret[ret.length - 1][0]) {
                outOfOrder = true;
            }
    Severity: Minor
    Found in src/utils/dygraph.js and 1 other location - About 45 mins to fix
    src/utils/dygraph.js on lines 4831..4833

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

    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 (abs > 0) {
                // Accept if element > val, but also if prior element < val.
                idx = mid - 1;
                if (validIndex(idx) && arry[idx] < val) {
                    return mid;
    Severity: Minor
    Found in src/utils/dygraph.js and 1 other location - About 45 mins to fix
    src/utils/dygraph.js on lines 5674..5680

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

    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 (abs < 0) {
                // Accept if element < val, but also if prior element > val.
                idx = mid + 1;
                if (validIndex(idx) && arry[idx] > val) {
                    return mid;
    Severity: Minor
    Found in src/utils/dygraph.js and 1 other location - About 45 mins to fix
    src/utils/dygraph.js on lines 5664..5670

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

    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 (this.element &&
          this.element.au &&
          this.element.au.controller &&
          typeof (this.element.au.controller) === 'object' &&
          this.element.au.controller.viewModel &&
    Severity: Major
    Found in src/attributes/value-convertor.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

          if (
              (typ != 'object' && !(typ == 'function' &&
                  typeof(o.item) == 'function')) ||
              o === null ||
              typeof(o.length) != 'number' ||
      Severity: Major
      Found in src/utils/dygraph.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if (this.element && this.element.au && this.element.au.controller && typeof (this.element.au.controller) === 'object' && this.element.au.controller.viewModel && typeof (this.element.au.controller.viewModel) === 'object') {
                this.elementVM = this.element.au.controller.viewModel;
                //check whether this.elementVM has changesrc function - to be called in event listener
                //this.isReadMDCustomElement = (typeof this.elementVM.changesrc === 'function');
            } else {console.warn('element viewmodel object doesnot exists, cant be called by handleXXX methods')}
        Severity: Major
        Found in src/attributes/fmu-index.js - About 40 mins to fix

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

                  this.init = function() {
                      ctx.beginPath();
                      ctx.strokeStyle = color;
                      ctx.lineWidth = strokeWidth;
                  };
          Severity: Minor
          Found in src/utils/dygraph.js and 1 other location - About 40 mins to fix
          src/utils/dygraph.js on lines 1150..1154

          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

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

              for (let myid of this.ids2send) {if (! document.getElementById(myid)) this.createids.push(myid);}
          Severity: Minor
          Found in src/elements/readdata.js and 1 other location - About 40 mins to fix
          src/elements/buttonparams.js on lines 76..76

          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

                  this.startSegment = function() {
                      ctx.beginPath();
                      ctx.strokeStyle = color;
                      ctx.lineWidth = strokeWidth;
                  };
          Severity: Minor
          Found in src/utils/dygraph.js and 1 other location - About 40 mins to fix
          src/utils/dygraph.js on lines 1171..1175

          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

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

                for (let myid of this.ids2send) {if (! document.getElementById(myid)) this.createids.push(myid);}
          Severity: Minor
          Found in src/elements/buttonparams.js and 1 other location - About 40 mins to fix
          src/elements/readdata.js on lines 29..29

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

          Dygraph.prototype.doAnimatedZoom = function(oldXRange, newXRange, oldYRanges, newYRanges, callback) {
          Severity: Minor
          Found in src/utils/dygraph.js - About 35 mins to fix

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

            var nonTrivialStrategy = function(renderer, ctx, color, strokeWidth, strokePattern) {
            Severity: Minor
            Found in src/utils/dygraph.js - About 35 mins to fix

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

              Dygraph.binarySearch = function(val, arry, abs, low, high) {
              Severity: Minor
              Found in src/utils/dygraph.js - About 35 mins to fix

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

                Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
                Severity: Minor
                Found in src/utils/dygraph.js - About 35 mins to fix

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

                  function renderFootnoteOpen(tokens, idx, options, env, slf) {
                  Severity: Minor
                  Found in src/elements/markdown-it-bfootnote.js - About 35 mins to fix

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

                    function renderFootnoteRef(tokens, idx, options, env, slf) {
                    Severity: Minor
                    Found in src/elements/markdown-it-bfootnote.js - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language