creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

File dygraph.js has 5651 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */
/**
 * @license
 * Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
 * MIT-licensed (http://opensource.org/licenses/MIT)
Severity: Major
Found in src/utils/dygraph.js - About 2 wks to fix

    Function _renderLineChart has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
    Open

    DygraphCanvasRenderer.prototype._renderLineChart = function() {
        // TODO(danvk): use this.attr_ for many of these.
        var ctx = this.elementContext;
        var fillAlpha = this.attr_('fillAlpha');
        var errorBars = this.attr_("errorBars") || this.attr_("customBars");
    Severity: Minor
    Found in src/utils/dygraph.js - About 2 days 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 bodylightFootnotePlugin has a Cognitive Complexity of 121 (exceeds 5 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: Minor
    Found in src/elements/markdown-it-bfootnote.js - About 2 days 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.convertors) {
          let convertvalues = this.convertors.split(';');
          let identity = x => x;
          this.operation = [];
          for (let i = 0; i < convertvalues.length; i++) {
    Severity: Major
    Found in src/elements/chartjs.js and 1 other location - About 2 days to fix
    src/elements/dygraphchart.js on lines 107..136

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

    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.convertors) {
              let convertvalues = this.convertors.split(';');
              let identity = x => x;
              this.operation = [];
              for (let i = 0; i < convertvalues.length; i++) {
    Severity: Major
    Found in src/elements/dygraphchart.js and 1 other location - About 2 days to fix
    src/elements/chartjs.js on lines 126..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 364.

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

    Dygraph.prototype.rollingAverage = function(originalData, rollPeriod) {
        if (originalData.length < 2)
            return originalData;
        rollPeriod = Math.min(rollPeriod, originalData.length);
        var rollingData = [];
    Severity: Minor
    Found in 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 numericTicks has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.numericTicks = function (a, b, pixels, opts, dygraph, vals) {
        //console.log("nt a " + a + " b " + b + " vals " + vals);
        var pixels_per_tick = opts('pixelsPerLabel');
        var ticks = [];
        var i, j, tickV, nTicks;
    Severity: Minor
    Found in 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 Legend has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.Plugins.Legend = (function() {
    
        /*
    
    Current bits of jankiness:
    Severity: Minor
    Found in 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 gatherDatasets_ has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
    Open

    Dygraph.prototype.gatherDatasets_ = function(rolledSeries, dateWindow) {
        var boundaryIds = [];
        var cumulative_y = [];  // For stacked series.
        var datasets = [];
        var extremes = {};  // series name -> [low, high]
    Severity: Minor
    Found in 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

    File fmi.js has 692 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {bindable,observable} from 'aurelia-framework';
    import _ from 'lodash';
    
    export const thirdpartytimeout = 5000;
    
    
    Severity: Major
    Found in src/elements/fmi.js - About 1 day to fix

      Function bind has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
      Open

        bind() {
          //console.log('chartjs bind');
          if ((typeof this.refindex == 'string') && (this.refindex.indexOf(',')>0)) { this.refindices = this.refindex.split(',')}
          else {
            this.refindex = myParseInt(this.refindex, 10);
      Severity: Minor
      Found in src/elements/chartjs.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 _renderAxis has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
      Open

      DygraphCanvasRenderer.prototype._renderAxis = function() {
          if (!this.attr_('drawXAxis') && !this.attr_('drawYAxis')) return;
      
          // Round pixels to half-integer boundaries for crisper drawing.
          function halfUp(x)  { return Math.round(x) + 0.5; }
      Severity: Minor
      Found in 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 computeYAxisRanges_ has a Cognitive Complexity of 71 (exceeds 5 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: Minor
      Found in 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

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

        constructor() {
          super();
          this.handleValueChange = e => {
            //e.detail do not reallocate - using same buffer, thus slicing to append to data array
            //let datapoints =e.detail.data.slice(this.refindex, this.refendindex);
      Severity: Major
      Found in src/elements/chartjs-pv.js and 1 other location - About 1 day to fix
      src/elements/chartjs-xy.js on lines 17..36

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

      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

        constructor() {
          super();
          this.handleValueChange = e => {
            //e.detail do not reallocate - using same buffer, thus slicing to append to data array
            //let datapoints =e.detail.data.slice(this.refindex, this.refendindex);
      Severity: Major
      Found in src/elements/chartjs-xy.js and 1 other location - About 1 day to fix
      src/elements/chartjs-pv.js on lines 12..31

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

      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 5 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 4 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

      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 5 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 4 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

      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 5 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 4 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

      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 5 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 4 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

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

      export default class AttributeGenerator {
        constructor(project, options, ui) {
          this.project = project;
          this.options = options;
          this.ui = ui;
      Severity: Major
      Found in aurelia_project/generators/attribute.js and 4 other locations - About 1 day to fix
      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

      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

      Severity
      Category
      Status
      Source
      Language