creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

Function getScript has a Cognitive Complexity of 21 (exceeds 5 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.log('fmi.getScript() WARNING, script is already added into DOM:', source);
      //do callback?
Severity: Minor
Found in src/elements/fmi.js - About 2 hrs 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 getDateAxis has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
    var formatter = opts("axisLabelFormatter");
    var ticks = [];
    var t;

Severity: Major
Found in src/utils/dygraph.js - About 2 hrs to fix

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

        round(value, decimals) {
            if (decimals < 0) {
                let posdecimals = -decimals;
                return Number(Math.round(value + 'e' + posdecimals) + 'e-' + posdecimals);
            }
    Severity: Major
    Found in src/elements/remote-value.js and 1 other location - About 2 hrs to fix
    src/elements/fmi.js on lines 583..586

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

    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

      round(value, decimals) {
        if (decimals < 0) {let posdecimals = -decimals; return Number(Math.round(value + 'e' + posdecimals) + 'e-' + posdecimals);}
        return Number(Math.round(value + 'e-' + decimals) + 'e+' + decimals);
      }
    Severity: Major
    Found in src/elements/fmi.js and 1 other location - About 2 hrs to fix
    src/elements/remote-value.js on lines 149..155

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

    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.editorapi.insertScriptById(source, 'adobeobj')
                  .then(innerscript => {
                    //console.log('third party script node', innerscript);
                    try {
                      // eslint-disable-next-line no-eval
    Severity: Major
    Found in src/elements/animate-adobe.js and 1 other location - About 2 hrs to fix
    src/elements/animate-adobe-ss.js on lines 173..183

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

    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.editorapi.insertScriptById(source, 'adobeobj')
                .then(innerscript => {
                  //console.log('third party script node', innerscript);
                  try {
                    // eslint-disable-next-line no-eval
    Severity: Major
    Found in src/elements/animate-adobe-ss.js and 1 other location - About 2 hrs to fix
    src/elements/animate-adobe.js on lines 239..249

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

    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 bind has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

      bind() {
        this.refindex = parseInt(this.refindex, 10);
        this.refvalues = parseInt(this.refvalues, 10);
        this.refendindex = this.refindex + this.refvalues;
    
    
    Severity: Minor
    Found in src/elements/plotly.js - About 2 hrs 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 3 locations. Consider refactoring.
    Open

        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?
          if (callback) setTimeout(callback, 0);
          return;
    Severity: Major
    Found in src/elements/animate-adobe-ss.js and 2 other locations - About 2 hrs to fix
    src/elements/animate-adobe.js on lines 218..223
    src/elements/fmi.js on lines 220..225

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

    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

        if (Array.from(document.getElementsByTagName('script')).filter(x=> x.getAttribute('src') === source).length > 0) {
          console.log('fmi.getScript() WARNING, script is already added into DOM:', source);
          //do callback?
          if (callback) setTimeout(callback, 0);
          return;
    Severity: Major
    Found in src/elements/fmi.js and 2 other locations - About 2 hrs to fix
    src/elements/animate-adobe-ss.js on lines 152..157
    src/elements/animate-adobe.js on lines 218..223

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

    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

          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?
            if (callback) setTimeout(callback, 0);
            return;
    Severity: Major
    Found in src/elements/animate-adobe.js and 2 other locations - About 2 hrs to fix
    src/elements/animate-adobe-ss.js on lines 152..157
    src/elements/fmi.js on lines 220..225

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

    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 start_ has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.prototype.start_ = function() {
        var data = this.file_;
    
        // Functions can return references of all other types.
        if (typeof data == 'function') {
    Severity: Minor
    Found in src/utils/dygraph.js - About 2 hrs 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 hslToRgb has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        hslToRgb(h, s, l) {
          let r; let g; let b;
    
          if (s === 0) {
            r = g = b = l; // achromatic
    Severity: Minor
    Found in src/elements/pdb-pdbe-molstar.js - About 2 hrs 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 refresh has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    let refresh = debounce(() => {
      if (isBuilding) {
        log('Watcher: A build is already in progress, deferring change detection...');
        return;
      }
    Severity: Minor
    Found in aurelia_project/tasks/watch.js - About 2 hrs 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 createDragInterface_ has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Dygraph.prototype.createDragInterface_ = function() {
        var context = {
            // Tracks whether the mouse is down right now
            isZooming: false,
            isPanning: false,  // is this drag part of a pan?
    Severity: Major
    Found in src/utils/dygraph.js - About 2 hrs to fix

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

                  if (this.chart.data.datasets[colorindex]) {
                      this.chart.data.datasets[colorindex].backgroundColor = this.previouscolor;
                      this.chart.data.datasets[colorindex].borderColor = this.previouscolor;
                  }
      Severity: Major
      Found in src/elements/chartjs-fixed-xy.js and 1 other location - About 2 hrs to fix
      src/elements/chartjs-fixed.js on lines 70..73

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

      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.chart.data.datasets[colorindex]) {
                      this.chart.data.datasets[colorindex].backgroundColor = this.previouscolor;
                      this.chart.data.datasets[colorindex].borderColor = this.previouscolor;
                  }
      Severity: Major
      Found in src/elements/chartjs-fixed.js and 1 other location - About 2 hrs to fix
      src/elements/chartjs-fixed-xy.js on lines 108..111

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

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

        function footnoteTail(state) {
          let i; let l; let j; let t; let lastParagraph; let list; let token; let tokens; let current; let currentLabel;
          let insideRef = false;
          let refTokens = {};
      
      
      Severity: Major
      Found in src/elements/markdown-it-bfootnote.js - About 2 hrs to fix

        Function binarySearch has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.binarySearch = function(val, arry, abs, low, high) {
            if (low === null || low === undefined ||
                high === null || high === undefined) {
                low = 0;
                high = arry.length - 1;
        Severity: Minor
        Found in src/utils/dygraph.js - About 2 hrs 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 getScript has a Cognitive Complexity of 18 (exceeds 5 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 2 hrs 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 getScript has a Cognitive Complexity of 18 (exceeds 5 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 2 hrs 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

        Severity
        Category
        Status
        Source
        Language