creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

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

        if (fromel) {
          this.registerAnimateEvents(fromel);
          if (this.fmuid) {this.registerFMUEvents(document.getElementById(this.fmuid))}
          else this.registerFMUEvents(fromel);
        } else {
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js and 1 other location - About 1 hr to fix
src_aurelia-bodylight-plugin/src/elements/animate-adobe.js on lines 75..82

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

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 (convertitems[0] === '1' && convertitems[1] === '1') this.operation.push(identity);
          else {
            let numerator = parseFloat(convertitems[0]);
            let denominator = parseFloat(convertitems[1]);
            this.operation.push(x => x * numerator / denominator);
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/plotly.js and 1 other location - About 1 hr to fix
src_aurelia-bodylight-plugin/src/attributes/value-convertor.js on lines 27..33

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

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

export function pluginMarkup(dest) {
  return function processPluginMarkup() {
    return gulp.src(project.plugin.source.html)
      .pipe(gulp.dest(dest));
  };
src_aurelia-bodylight-plugin/aurelia_project/tasks/process-css.js on lines 10..15
src_aurelia-bodylight-plugin/aurelia_project/tasks/process-json.js on lines 10..15

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

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

export function pluginJson(dest) {
  return function processPluginJson() {
    return gulp.src(project.plugin.source.json)
      .pipe(gulp.dest(dest));
  };
src_aurelia-bodylight-plugin/aurelia_project/tasks/process-css.js on lines 10..15
src_aurelia-bodylight-plugin/aurelia_project/tasks/process-markup.js on lines 10..15

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

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 if (regionHeight >= 10 && context.dragDirection == Dygraph.VERTICAL) {
        g.doZoomY_(Math.min(context.dragStartY, context.dragEndY),
            Math.max(context.dragStartY, context.dragEndY));
        context.cancelNextDblclick = true;
    } else {
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 1 hr to fix
src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 6606..6616

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

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 (fromel) {
          this.registerAnimateEvents(fromel);
          if (this.fmuid) {this.registerFMUEvents(document.getElementById(this.fmuid))}
          else this.registerFMUEvents(fromel);
        } else {
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js and 1 other location - About 1 hr to fix
src_aurelia-bodylight-plugin/src/elements/animate-adobe.js on lines 35..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 61.

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

export function pluginCSS(dest) {
  return function processPluginCSS() {
    return gulp.src(project.plugin.source.css)
      .pipe(gulp.dest(dest));
  };
src_aurelia-bodylight-plugin/aurelia_project/tasks/process-json.js on lines 10..15
src_aurelia-bodylight-plugin/aurelia_project/tasks/process-markup.js on lines 10..15

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

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 (regionWidth >= 10 && context.dragDirection == Dygraph.HORIZONTAL) {
        g.doZoomX_(Math.min(context.dragStartX, context.dragEndX),
            Math.max(context.dragStartX, context.dragEndX));
        context.cancelNextDblclick = true;
    } else if (regionHeight >= 10 && context.dragDirection == Dygraph.VERTICAL) {
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 1 hr to fix
src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 6610..6616

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

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

  bind() {
    //
    let convertvalues = this.value.split(';');
    let identity = x => x;
    this.operation = [];
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/attributes/value-convertor.js - About 1 hr to fix

    Function fromFieldsV7 has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static fromFieldsV7(unixTsMs, randA, randBHi, randBLo) {
            if (!Number.isInteger(unixTsMs) ||
                !Number.isInteger(randA) ||
                !Number.isInteger(randBHi) ||
                !Number.isInteger(randBLo) ||
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/utils/uuidv7.js - About 1 hr to fix

      Function beforeDatasetsDraw has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            beforeDatasetsDraw: function(chart, easing) {
              const acidbaseannotation = [[7.4,40,"Normal area"],
              [7.2,64,"Acute Hypercapnia"],
              [7.1,35,"Acute Base Deficit"],
              [7.1,18,"Chronic Base Deficit"],
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/chartjs-xy-sachart.js - About 1 hr to fix

        Function treatMouseOpAsClick has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.Interaction.treatMouseOpAsClick = function(g, event, context) {
            var clickCallback = g.attr_('clickCallback');
            var pointClickCallback = g.attr_('pointClickCallback');
        
            var selectedPoint = null;
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function mouseMove_ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.prototype.mouseMove_ = function(event) {
            // This prevents JS errors when mousing over the canvas before data loads.
            var points = this.layout_.points;
            if (points === undefined) return;
        
        
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function mapLegacyOptions_ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.mapLegacyOptions_ = function(attrs) {
            var my_attrs = {};
            for (var k in attrs) {
                if (k == 'file') continue;
                if (attrs.hasOwnProperty(k)) my_attrs[k] = attrs[k];
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function convertf2a has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            convertf2a(x) {
              //do conversion if operation is defined
              if (this.operation) x = this.operation(x);
              //initially sets minimum as 1/2 of current value, otherwise update it
              if (!this.afminset) {
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/bind2animation.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            constructor() {
              super();
              this.handleValueChange = e => {
                //e.detail do not reallocate - using same buffer, thus slicing to append to data array
                let rawdata = e.detail.data.slice(this.refindex, this.refendindex);
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/chartjs-xy-points.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            bind() {
              this.divstyle = `width:${this.width};height:${this.height}; position:relative`;
              console.log('bind() moleculeId,hidecontrols,hidepolymer,moleculeidref', this.moleculeId, this.hideControls, this.hidePolymer, this.parentref);
              this.pdbref = document.createElement('pdbe-molstar');
              if (this.moleculeId) this.pdbref.setAttribute('molecule-id', this.moleculeId);
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/pdb-pdbe-molstar.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

          bind() {
            this.isOneshot = this.mode === 'oneshot';
            this.isOnestep = this.mode === 'onestep';
            if (this.isOnestep) {
              this.showcontrols = false;
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/fmi.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function destroyAdobe has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          destroyAdobe() {
            console.log('animate adobe ss destroy()');
            if (this.stage) {
              this.stage.enableMouseOver(-1);
              this.stage.enableDOMEvents(false);
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe-ss.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function changesrc has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            changesrc(args) {
              console.log('markdown-bottom-nav changesrc args:', args);
              //console.log('markdown-bottom-nav links:', this.links);
              //parse global window.markdownnav.links to get prev and next title
              //let prevtitle = '';
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/markdown-bottom-nav.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Severity
        Category
        Status
        Source
        Language