creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

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

      if (((this.elimits[1] - parseFloat(this.initialdata)) / (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_aurelia-bodylight-plugin/src/elements/chartjs-barplot.js and 1 other location - About 45 mins to fix
src_aurelia-bodylight-plugin/src/elements/chartjs-barplot.js on lines 40..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 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 (ret.length > 0 && fields[0] < ret[ret.length - 1][0]) {
            outOfOrder = true;
        }
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 45 mins to fix
src_aurelia-bodylight-plugin/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

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_aurelia-bodylight-plugin/src/attributes/fmu-index.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 &&
    Severity: Major
    Found in src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/utils/dygraph.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_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 40 mins to fix
        src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/elements/readdata.js and 1 other location - About 40 mins to fix
        src_aurelia-bodylight-plugin/src/elements/buttonparams.js on lines 79..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 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_aurelia-bodylight-plugin/src/elements/buttonparams.js and 1 other location - About 40 mins to fix
        src_aurelia-bodylight-plugin/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

        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_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 40 mins to fix
        src_aurelia-bodylight-plugin/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

        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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 mins to fix

              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_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 mins to fix

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

                function renderFootnoteAnchor(tokens, idx, options, env, slf) {
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.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_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 35 mins to fix

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

                          this.mdtoc.renderer.rules.bullet_list_close = function(tokens, idx, options, env, slf) { if (window.markdownnavdepth) window.markdownnavdepth--; return '</ul>';};
                      Severity: Minor
                      Found in src_aurelia-bodylight-plugin/src/elements/markdownnav.js - About 35 mins to fix

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

                            this.mdtoc.renderer.rules.bullet_list_open = function(tokens, idx, options, env, slf) {
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/elements/markdownnav.js - About 35 mins to fix

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

                              this.mdtoc.renderer.rules.list_item_open = function(tokens, idx, options, env, slf) {
                          Severity: Minor
                          Found in src_aurelia-bodylight-plugin/src/elements/markdownnav.js - About 35 mins to fix

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

                                    if (document.getElementById(this.fromid)) {
                                      document.getElementById(this.fromid).removeEventListener('fmidata', this.handleValueChange);
                                    }
                            Severity: Minor
                            Found in src_aurelia-bodylight-plugin/src/elements/buttonparams.js and 1 other location - About 35 mins to fix
                            src_aurelia-bodylight-plugin/src/elements/ecg.js on lines 75..77

                            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