creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

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

export default class ValueConverterGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/task.js on lines 5..40
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..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 250.

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 10 locations. Consider refactoring.
Open

export default class TaskGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/task.js on lines 5..40
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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 10 locations. Consider refactoring.
Open

export default class GeneratorGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
Severity: Major
Found in aurelia_project/generators/generator.js and 9 other locations - About 1 day to fix
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/task.js on lines 5..40
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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 10 locations. Consider refactoring.
Open

export default class GeneratorGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/task.js on lines 5..40
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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 10 locations. Consider refactoring.
Open

export default class BindingBehaviorGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/task.js on lines 5..40
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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 10 locations. Consider refactoring.
Open

export default class AttributeGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/task.js on lines 5..40
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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 10 locations. Consider refactoring.
Open

export default class BindingBehaviorGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
Severity: Major
Found in aurelia_project/generators/binding-behavior.js and 9 other locations - About 1 day to fix
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/task.js on lines 5..40
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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 10 locations. Consider refactoring.
Open

export default class TaskGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
Severity: Major
Found in aurelia_project/generators/task.js and 9 other locations - About 1 day to fix
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/value-converter.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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 10 locations. Consider refactoring.
Open

export default class ValueConverterGenerator {
  constructor(project, options, ui) {
    this.project = project;
    this.options = options;
    this.ui = ui;
Severity: Major
Found in aurelia_project/generators/value-converter.js and 9 other locations - About 1 day to fix
aurelia_project/generators/attribute.js on lines 5..44
aurelia_project/generators/binding-behavior.js on lines 5..41
aurelia_project/generators/generator.js on lines 5..72
aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/attribute.js on lines 5..44
src_aurelia-bodylight-plugin/aurelia_project/generators/binding-behavior.js on lines 5..41
src_aurelia-bodylight-plugin/aurelia_project/generators/generator.js on lines 5..72
src_aurelia-bodylight-plugin/aurelia_project/generators/task.js on lines 5..40
src_aurelia-bodylight-plugin/aurelia_project/generators/value-converter.js on lines 5..41

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

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

function sub_plugin(md) {
  var escapeRE        = md.utils.escapeRE,
      arrayReplaceAt  = md.utils.arrayReplaceAt;

  // ASCII characters in Cc, Sc, Sm, Sk categories we should terminate on;
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 1 day 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 computeCombinedSeriesAndLimits_ has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
Open

DygraphRangeSelector.prototype.computeCombinedSeriesAndLimits_ = function() {
    var data = this.dygraph_.rawData_;
    var logscale = this.attr_('logscale');

    // Create a combined series (average of all series values).
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 day 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 parseCSV_ has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
Open

Dygraph.prototype.parseCSV_ = function(data) {
    var ret = [];
    var lines = data.split("\n");
    var vals, j;

Severity: Minor
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 day 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 parseDataTable_ has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
Open

Dygraph.prototype.parseDataTable_ = function(data) {
    var shortTextForAnnotationNum = function(num) {
        // converts [0-9]+ [A-Z][a-z]*
        // example: 0=A, 1=B, 25=Z, 26=Aa, 27=Ab
        // and continues like.. Ba Bb .. Za .. Zz..Aaa...Zzz Aaaa Zzzz
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 day 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 initInteraction_ has 227 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DygraphRangeSelector.prototype.initInteraction_ = function() {
    var self = this;
    var topElem = this.isIE_ ? document : window;
    var xLast = 0;
    var handle = null;
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 day to fix

    Function RGBColor has 218 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function RGBColor(color_string)
    {
        this.ok = false;
    
        // strip any leading #
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 day to fix

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

          if (this.min) {
            //sets yscale min
            if (!this.options) this.options = {};
            if (!this.options.scales) this.options.scales = {};
            if (!this.options.scales.yAxes) this.options.scales.yAxes = [{}]; //chartjs 2.9.4
      Severity: Major
      Found in src_aurelia-bodylight-plugin/src/elements/chartjs.js and 1 other location - About 1 day to fix
      src_aurelia-bodylight-plugin/src/elements/chartjs-xy-points.js on lines 49..56

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

      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.xmin) {
              //sets yscale min
              if (!this.options) this.options = {};
              if (!this.options.scales) this.options.scales = {};
              if (!this.options.scales.xAxes) this.options.scales.xAxes = [{}]; //chartjs 2.9.4
      src_aurelia-bodylight-plugin/src/elements/chartjs.js on lines 312..319

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

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

      export function bodylightFootnotePlugin(md) {
        let parseLinkLabel = md.helpers.parseLinkLabel;
        let isSpace = md.utils.isSpace;
      
        md.renderer.rules.footnote_ref          = renderFootnoteRef;
      Severity: Major
      Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 1 day to fix

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

              if (this.xmax) {
                //sets yscale max
                if (!this.options) this.options = {};
                if (!this.options.scales) this.options.scales = {};
                if (!this.options.scales.xAxes) this.options.scales.xAxes = [{}]; //chartjs 2.9.4
        src_aurelia-bodylight-plugin/src/elements/chartjs.js on lines 320..328

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

        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.max) {
              //sets yscale max
              if (!this.options) this.options = {};
              if (!this.options.scales) this.options.scales = {};
              if (!this.options.scales.yAxes) this.options.scales.yAxes = [{}]; //chartjs 2.9.4
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/elements/chartjs.js and 1 other location - About 1 day to fix
        src_aurelia-bodylight-plugin/src/elements/chartjs-xy-points.js on lines 57..65

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

        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