creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

Function markdownitbtoc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export function markdownitbtoc(md, _options) {
  // Set default options
  let options = Object.assign({}, defaultOptions, _options);

  // Global variables
Severity: Minor
Found in src/elements/markdown-it-btoc.js - About 3 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 2 locations. Consider refactoring.
Open

      if (this.autofmax) {
        //initially sets maximum as 2x of current value, otherwise update it
        if (!this.afmaxset) {
          this.fmax = x*1.1;
          this.afmaxset = true;
Severity: Major
Found in src/elements/bind2animation.js and 1 other location - About 3 hrs to fix
src/elements/bind2animation.js on lines 42..54

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

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.autofmin) {
        //initially sets minimum as 1/2 of current value, otherwise update it
        if (!this.afminset) {
          this.fmin = x*0.9;
          this.afminset = true;
Severity: Major
Found in src/elements/bind2animation.js and 1 other location - About 3 hrs to fix
src/elements/bind2animation.js on lines 58..70

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

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.element &&
      this.element.au &&
      this.element.au.controller &&
      typeof (this.element.au.controller) === 'object' &&
      this.element.au.controller.viewModel &&
Severity: Major
Found in src/attributes/value-convertor.js and 1 other location - About 3 hrs to fix
src/attributes/fmu-index.js on lines 40..44

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

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.element && this.element.au && this.element.au.controller && typeof (this.element.au.controller) === 'object' && this.element.au.controller.viewModel && typeof (this.element.au.controller.viewModel) === 'object') {
        this.elementVM = this.element.au.controller.viewModel;
        //check whether this.elementVM has changesrc function - to be called in event listener
        //this.isReadMDCustomElement = (typeof this.elementVM.changesrc === 'function');
    } else {console.warn('element viewmodel object doesnot exists, cant be called by handleXXX methods')}
Severity: Major
Found in src/attributes/fmu-index.js and 1 other location - About 3 hrs to fix
src/attributes/value-convertor.js on lines 49..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 102.

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

  bind() {
    if (this.speedfactor) {
      if (typeof this.speedfactor === 'string') this.speedfactor = parseInt(this.speedfactor, 10);
      if (this.speedfactor <= 0 || this.speedfactor > 100) this.speedfactor = 100;
    }
Severity: Minor
Found in src/elements/animate-control.js - About 3 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 computeYAxisRanges_ has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.prototype.computeYAxisRanges_ = function (extremes) {
    // Build a map from axis number -> [list of series names]
    var seriesForAxis = [], series;
    for (series in this.seriesToAxisMap_) {
        if (!this.seriesToAxisMap_.hasOwnProperty(series)) continue;
Severity: Major
Found in src/utils/dygraph.js - About 3 hrs to fix

    AnimateAdobe has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class AnimateAdobe {
        @bindable src;
        @bindable width=800;
        @bindable height=600;
        @bindable name;//="ZelezoCelek"
    Severity: Minor
    Found in src/elements/animate-adobe.js - About 3 hrs to fix

      Function isPixelChangingOptionList has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Dygraph.isPixelChangingOptionList = function(labels, attrs) {
          // A whitelist of options that do not change pixel positions.
          var pixelSafeOptions = {
              'annotationClickHandler': true,
              'annotationDblClickHandler': true,
      Severity: Major
      Found in src/utils/dygraph.js - About 3 hrs to fix

        Function computeYAxes_ has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Dygraph.prototype.computeYAxes_ = function() {
            // Preserve valueWindow settings if they exist, and if the user hasn't
            // specified a new valueRange.
            var i, valueWindows, seriesName, axis, index, opts, v;
            if (this.axes_ !== undefined && this.user_attrs_.hasOwnProperty("valueRange") === false) {
        Severity: Major
        Found in src/utils/dygraph.js - About 3 hrs to fix

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

              if (context.touchDirections.x) {
                  g.dateWindow_ = [
                      c_init.dataX - swipe.dataX + (context.initialRange.x[0] - c_init.dataX) / xScale,
                      c_init.dataX - swipe.dataX + (context.initialRange.x[1] - c_init.dataX) / xScale
                  ];
          Severity: Major
          Found in src/utils/dygraph.js and 1 other location - About 3 hrs to fix
          src/utils/dygraph.js on lines 6747..6752

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

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

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

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

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

          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

                      } else {
                          axis.valueWindow = [
                              c_init.dataY - swipe.dataY + (context.initialRange.y[0] - c_init.dataY) / yScale,
                              c_init.dataY - swipe.dataY + (context.initialRange.y[1] - c_init.dataY) / yScale
                          ];
          Severity: Major
          Found in src/utils/dygraph.js and 1 other location - About 3 hrs to fix
          src/utils/dygraph.js on lines 6735..6740

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

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

          Dygraph.updateDeep = function (self, o) {
              // Taken from http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
              function isNode(o) {
                  return (
                      typeof Node === "object" ? o instanceof Node :
          Severity: Minor
          Found in src/utils/dygraph.js - About 3 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 RGBColor has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

          function RGBColor(color_string)
          {
              this.ok = false;
          
              // strip any leading #
          Severity: Minor
          Found in src/utils/dygraph.js - About 3 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 bind has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              bind() {
                super.bind();
                this.plugins = [ChartDataLabels];
                if (this.extremelimits) {
                  this.elimits = this.extremelimits.split(','); //split by comma
          Severity: Major
          Found in src/elements/chartjs-barplot.js - About 3 hrs to fix

            Function constructor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

              constructor() {
                //document.getElementById("id${window.ids - 2}").addEventListener("change", myfun${window.ids});
                /*function myfun${window.ids}(event){
                    document.getElementById("id${window.ids - 1}").value = event.target.value;
               }*/
            Severity: Minor
            Found in src/elements/bind2previous.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