creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

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

        this.navtitle = (currentlinkindex > 0) && (currentlinkindex < window.markdownnav.links.length)
          ? window.markdownnav.links[currentlinkindex].title
          : '';
src_aurelia-bodylight-plugin/src/elements/markdown-top-nav.js on lines 120..122

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

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.navtitle = (currentlinkindex > 0) && (currentlinkindex < window.markdownnav.links.length)
          ? window.markdownnav.links[currentlinkindex].title
          : '';
src_aurelia-bodylight-plugin/src/elements/markdown-top-nav.js on lines 55..57

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

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 convertf2a has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    convertf2a(x) {
      //do conversion if operation is defined
      if (this.operation) x = this.operation(x);
      //initially sets minimum as 1/2 of current value, otherwise update it
      if (!this.afminset) {
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/bind2animation.js - About 1 hr to fix

    Function attached has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      attached() {
        //console.log('bdlmarkdownaurelia attached() src:', this.src);
        // eslint-disable-next-line new-cap
        //optionally, register customevent handler for 'contentupdate' when fromid is defined
        // eslint-disable-next-line new-cap
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/markdownaurelia.js - About 1 hr to fix

      Function handleValueChange has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.handleValueChange = e => {
            let datapoint = [];
            if (!this.xy) datapoint.push(e.detail.time);
            //e.detail do not reallocate - using same buffer, thus slicing to append to data array
            let edata = e.detail.data.slice();
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/dygraphchart.js - About 1 hr to fix

        Function toc_body has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          md.renderer.rules.toc_body = function(tokens, index) {
            let results = [];
            let previousLevel = 0;
        
            for (let i = 0; i < headingInfos.length; i++) {
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-btoc.js - About 1 hr to fix

          Function _drawSeries has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              ctx, iter, strokeWidth, pointSize, drawPoints, drawGapPoints,
              stepPlot, strategy) {
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

            Function drawZoomRect_ has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            Dygraph.prototype.drawZoomRect_ = function(direction, startX, endX, startY,
                                                       endY, prevDirection, prevEndX,
                                                       prevEndY) {
            Severity: Major
            Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

              Function DrawPolygon_ has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              Dygraph.DrawPolygon_ = function(sides, rotationRadians, ctx, cx, cy, color, radius, delta) {
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

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

                    if (this.attr_('y2label') && this.dygraph_.numAxes() == 2) {
                        div = createRotatedDiv(2, 'dygraph-label dygraph-y2label',
                            this.attr_('y2label'));
                        this.container.appendChild(div);
                        this.chartLabels.y2label = div;
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 1 hr to fix
                src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 989..994

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

                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 (this.attr_('ylabel')) {
                        div = createRotatedDiv(1, 'dygraph-label dygraph-ylabel',
                            this.attr_('ylabel'));
                        this.container.appendChild(div);
                        this.chartLabels.ylabel = div;
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 1 hr to fix
                src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 995..1000

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

                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

                    this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 2 other locations - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 8280..8280
                src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 8281..8281

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

                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

                    this.domContainers.forEach(function(container) {
                      container.style.width = w * sRatio + 'px';
                      container.style.height = h * sRatio + 'px';
                    });
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe-ss.js and 1 other location - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/elements/animate-adobe.js on lines 154..157

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

                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

                    if (this.dataevent) {
                      let c = new CustomEvent('fmivalue', {detail: {value: this.value}});
                      this.element.dispatchEvent(c);
                    }
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/value.js and 1 other location - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/elements/value-boolean.js on lines 14..17

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

                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

                    if (fromel) {
                      fromel.addEventListener('fmidata', this.handleValueChange);
                    } else {
                      console.warn('chartjs, null fromid element, waiting to be attached');
                      document.addEventListener('fmiattached',this.handleFMIAttached);
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/value-store.js and 1 other location - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/elements/value.js on lines 95..100

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

                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

                    this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 2 other locations - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 8281..8281
                src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 8282..8282

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

                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

                      window.ani.domContainers.forEach(function(container) {
                        container.style.width = w * sRatio + 'px';
                        container.style.height = h * sRatio + 'px';
                      });
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js and 1 other location - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/elements/animate-adobe-ss.js on lines 241..244

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

                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

                    if (fromel) {
                      fromel.addEventListener('fmidata', this.handleValueChange);
                    } else {
                      console.warn('chartjs, null fromid element, waiting to be attached');
                      document.addEventListener('fmiattached',this.handleFMIAttached);
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/value.js and 1 other location - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/elements/value-store.js on lines 42..47

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

                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 (fromel) {
                        fromel.addEventListener('fmidata', this.handleValueChange);
                        fromel.addEventListener('fmireset', this.handleReset);
                      } else {console.warn('plotly element WARNING, null fromid element');}
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/plotly.js and 1 other location - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/elements/plotly.js on lines 104..107

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

                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

                        if (this.dataevent) {
                            let c = new CustomEvent('fmivalue', {detail: {value: this.value}});
                            this.element.dispatchEvent(c);
                        }
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/value-boolean.js and 1 other location - About 55 mins to fix
                src_aurelia-bodylight-plugin/src/elements/value.js on lines 131..134

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

                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