creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

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/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 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/utils/dygraph.js - About 1 hr to fix

    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/utils/dygraph.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/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/elements/animate-adobe-ss.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/elements/animate-adobe.js - About 1 hr to fix

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

                    if (window.thisfmi.isOnestep) {
                      //console.log('onestep scheduling startevent in promise() to do step()')
                      setTimeout(window.thisfmi.sendStartEvent.bind(window.thisfmi),1000);
                      console.log('onestep scheduling promise() to do step()')
                      //setTimeout(window.thisfmi.step.bind(window.thisfmi),1500);
            Severity: Major
            Found in src/elements/fmi.js and 1 other location - About 1 hr to fix
            src/elements/fmi.js on lines 290..300

            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/elements/dygraphchart.js and 1 other location - About 1 hr to fix
            src/elements/dygraphchart.js on lines 43..49

            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/elements/dygraphchart.js and 1 other location - About 1 hr to fix
            src/elements/dygraphchart.js on lines 34..40

            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

                    if (window.thisfmi.isOneshot) {
                      //console.log('oneshot scheduling startevent in promise() to do step()')
                      setTimeout(window.thisfmi.sendStartEvent.bind(window.thisfmi),1000);
                      console.log('oneshot scheduling promise() to do shot()')
                      //setTimeout(window.thisfmi.shot.bind(window.thisfmi),1500);
            Severity: Major
            Found in src/elements/fmi.js and 1 other location - About 1 hr to fix
            src/elements/fmi.js on lines 283..300

            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

            Function log has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Dygraph.log = function(severity, message) {
                var st;
                if (typeof(printStackTrace) != 'undefined') {
                    // Remove uninteresting bits: logging functions and paths.
                    st = printStackTrace({guess:false});
            Severity: Minor
            Found in src/utils/dygraph.js - About 1 hr to fix

              Function handleResize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                handleResize() {
                  console.log('animateadobe handleResize()');
                  //do not run if ani.lib is not defined - no adobe component is available
                  if (!this.lib) return;
                  let w = this.lib.properties.width; let h = this.lib.properties.height;
              Severity: Minor
              Found in src/elements/animate-adobe-ss.js - About 1 hr to fix

                Function handleResize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    handleResize() {
                      console.log('animateadobe handleResize()');
                      //do not run if ani.lib is not defined - no adobe component is available
                      if (!window.ani.lib) return;
                      let w = window.ani.lib.properties.width; let h = window.ani.lib.properties.height;
                Severity: Minor
                Found in src/elements/animate-adobe.js - About 1 hr to fix

                  Function afterDraw has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  afterDraw: (chart) => {
                                      if (chart.config.options.refpointplugin) {
                                          const ctx = chart.canvas.getContext('2d');
                                          ctx.save();
                  
                  
                  Severity: Minor
                  Found in src/elements/chartjs-fixed.js - About 1 hr to fix

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

                            if (regionWidth < 2 && regionHeight < 2 &&
                                g.lastx_ !== undefined && g.lastx_ != -1) {
                                Dygraph.Interaction.treatMouseOpAsClick(g, event, context);
                            }
                    Severity: Major
                    Found in src/utils/dygraph.js and 1 other location - About 1 hr to fix
                    src/utils/dygraph.js on lines 6601..6604

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

                    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 (regionWidth < 2 && regionHeight < 2 &&
                            g.lastx_ !== undefined && g.lastx_ != -1) {
                            Dygraph.Interaction.treatMouseOpAsClick(g, event, context);
                        }
                    Severity: Major
                    Found in src/utils/dygraph.js and 1 other location - About 1 hr to fix
                    src/utils/dygraph.js on lines 6865..6868

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

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

                    DygraphCanvasRenderer.prototype.clear = function() {
                        var context;
                        if (this.isIE) {
                            // VML takes a while to start up, so we just poll every this.IEDelay
                            try {
                    Severity: Minor
                    Found in src/utils/dygraph.js - About 1 hr to fix

                      Function _evaluateLimits has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      DygraphLayout.prototype._evaluateLimits = function () {
                          //TODO(tomaton): fix xrange when last x value is not the highest in case of x = sin(y) x is from 0 to 1 and back to 0
                          //and range for x is 0 to 1
                          this.minxval = this.maxxval = null;
                          if (this.dateWindow_) {
                      Severity: Minor
                      Found in src/utils/dygraph.js - About 1 hr to fix

                        Function generateSource has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          generateSource(className) {
                            return `import {inject} from 'aurelia-dependency-injection';
                        import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
                        
                        @inject(Project, CLIOptions, UI)
                        Severity: Minor
                        Found in aurelia_project/generators/generator.js - About 1 hr to fix

                          Function constructor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            constructor() {
                              //this.data = [[0, 0, 0]];
                          
                              //this.data=[[1, 5], [2, 5], [3, 4.9], [4, 4.8], [5, 5.2]];
                          
                          
                          Severity: Minor
                          Found in src/elements/dygraphchart.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language