creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

Function bind has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    bind() {
        super.bind();
        if (typeof this.timedenomfixed === 'string') this.timedenomfixed = parseInt(this.timedenomfixed,10);                
        if (typeof this.timedenom === 'string') {
            
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/chartjs-time.js - About 1 hr to fix

    Function addAnnotationRule has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.addAnnotationRule = function() {
        if (Dygraph.addedAnnotationCSS) return;
    
        var rule = "border: 1px solid black; " +
            "background-color: white; " +
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.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 numDateTicks has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.numDateTicks = function(start_time, end_time, granularity) {
        if (granularity < Dygraph.MONTHLY) {
            // Generate one tick mark for every fixed interval of time.
            var spacing = Dygraph.SHORT_SPACINGS[granularity];
            return Math.floor(0.5 + 1.0 * (end_time - start_time) / spacing);
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.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 attr_ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.prototype.attr_ = function(name, seriesName) {
    
        var sources = [];
        sources.push(this.attrs_);
        if (this.user_attrs_) {
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.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 computePlotArea_ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    DygraphLayout.prototype.computePlotArea_ = function() {
        var area = {
            // TODO(danvk): per-axis setting.
            x: 0,
            y: 0
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.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 dateParser has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.dateParser = function(dateStr) {
        var dateStrSlashed;
        var d;
    
        // Let the system try the format first, with one caveat:
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.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 _dashedLine has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    DygraphCanvasRenderer.prototype._dashedLine = function(ctx, x, y, x2, y2, pattern) {
        // Original version http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas
        // Modified by Russell Valentine to keep line history and continue the pattern
        // where it left off.
        var dx, dy, len, rot, patternIndex, segment;
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.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 deregisterInputs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      deregisterInputs() {
        console.warn('deregistering inputs');//do removeListeners()
        window.animateranges = [];
        if (this.inputs) {
          let inputparts = this.inputs.split(';');
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/fmi.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 setInputVariables has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      setInputVariables() {
        for (let key in this.changeinputs) {
          let myinputs = this.changeinputs[key];
          //console.log('changing inputs', myinputs);
          //set real - reference is in - one input one reference
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/fmi.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 constructor has a Cognitive Complexity of 12 (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_aurelia-bodylight-plugin/src/elements/chartjs-barplot.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 _evaluateLineCharts has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    DygraphLayout.prototype._evaluateLineCharts = function() {
        // An array to keep track of how many points will be drawn for each set.
        // This will allow for the canvas renderer to not have to check every point
        // for every data set since the points are added in order of the sets in
        // datasets.
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

      Function doAnimatedZoom has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Dygraph.prototype.doAnimatedZoom = function(oldXRange, newXRange, oldYRanges, newYRanges, callback) {
          var steps = this.attr_("animatedZooms") ? Dygraph.ANIMATION_STEPS : 1;
      
          var windows = [];
          var valueRanges = [];
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

        Function getScript has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          getScript(source, callback) {
            //check whether the script is not already there
            if (Array.from(document.getElementsByTagName('script')).filter(x=> x.getAttribute('src') === source).length > 0) {
              console.warn('AnimateAdobe.getScript() WARNING, script is already added into DOM:', source);
              //do callback?
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe-ss.js - About 1 hr to fix

          Function bind has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              bind() {
                super.bind();
                console.log('chartjs xy point bind()');
                if (this.xmin) {
                  //sets yscale min
          Severity: Minor
          Found in src_aurelia-bodylight-plugin/src/elements/chartjs-xy-points.js - About 1 hr to fix

            Function getScript has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getScript(source, callback) {
                  //check whether the script is not already there
                  if (Array.from(document.getElementsByTagName('script')).filter(x=> x.getAttribute('src') === source).length > 0) {
                    console.warn('AnimateAdobe.getScript() WARNING, script is already added into DOM:', source);
                    //do callback?
            Severity: Minor
            Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 1 hr to fix

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

                          case 36:
                              hex =
                                  (_b = /^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i
                                      .exec(uuid)) === null || _b === void 0 ? void 0 : _b.slice(1, 6).join("");
                              break;
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/uuidv7.js and 2 other locations - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/utils/uuidv7.js on lines 101..105
              src_aurelia-bodylight-plugin/src/utils/uuidv7.js on lines 106..110

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

              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

                          case 38:
                              hex =
                                  (_c = /^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i
                                      .exec(uuid)) === null || _c === void 0 ? void 0 : _c.slice(1, 6).join("");
                              break;
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/uuidv7.js and 2 other locations - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/utils/uuidv7.js on lines 96..100
              src_aurelia-bodylight-plugin/src/utils/uuidv7.js on lines 106..110

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

              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

                      for (let i = this.refindex; i < this.refindex + this.refvalues; i++) {
                        if (this.operation) {
                          datapoint.push(this.operation[opindex](edata[i]));
                          opindex++;
                        } else 
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/elements/dygraphchart.js and 1 other location - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/elements/dygraphchart.js on lines 33..39

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

              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

                          case 45:
                              hex =
                                  (_d = /^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i
                                      .exec(uuid)) === null || _d === void 0 ? void 0 : _d.slice(1, 6).join("");
                              break;
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/uuidv7.js and 2 other locations - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/utils/uuidv7.js on lines 96..100
              src_aurelia-bodylight-plugin/src/utils/uuidv7.js on lines 101..105

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

              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

                      for (let myindex of this.refindices) {
                        if (this.operation) {
                          datapoint.push(this.operation[opindex](edata[myindex]));
                          opindex++;
                        } else 
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/elements/dygraphchart.js and 1 other location - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/elements/dygraphchart.js on lines 42..48

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

              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