creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

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

    setactive(id) {
      let el = document.getElementById(id.name);
      if (el) {
        el.style.display = 'block';
        id.cls = this.activeclass;
Severity: Major
Found in src/elements/tabs.js and 1 other location - About 1 hr to fix
src/elements/tabs.js on lines 79..85

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

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

DygraphLayout.prototype.computePlotArea_ = function() {
    var area = {
        // TODO(danvk): per-axis setting.
        x: 0,
        y: 0
Severity: Minor
Found in src/utils/dygraph.js - About 1 hr to fix

    Function setSelection has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Dygraph.prototype.setSelection = function(row, opt_seriesName) {
        // Extract the points we've selected
        this.selPoints_ = [];
        var pos = 0;
    
    
    Severity: Minor
    Found in src/utils/dygraph.js - About 1 hr to fix

      Function footnoteRef has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function footnoteRef(state, silent) {
          let label;
          let pos;
          let footnoteId;
          let footnoteSubId;
      Severity: Minor
      Found in src/elements/markdown-it-bfootnote.js - About 1 hr to fix

        Function processValue has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          processValue(value) {
            //compare with current segment condition
            //do stop simulation if the condition in 'relation' is met - returns true
            let referencevalue = this.segmentconditions[this.currentsegment].value;
            if (this.segmentconditions[this.currentsegment].relation(value, referencevalue)) {
        Severity: Minor
        Found in src/elements/animate-control.js - About 1 hr to fix

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

              attached() {
                this.ea.subscribe('navchange', navstruct => this.updatenav(navstruct));
                this.ea.subscribe('hashchange', hashstruct => this.changesrc(hashstruct));
              }
          Severity: Major
          Found in src/elements/markdown-bottom-nav.js and 1 other location - About 1 hr to fix
          src/elements/markdown-top-nav.js on lines 28..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 64.

          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

          export default function processCSS() {
            return gulp.src(project.cssProcessor.source, {sourcemaps: true, since: gulp.lastRun(processCSS)})
              .pipe(build.bundle());
          }
          Severity: Major
          Found in aurelia_project/tasks/process-css.js and 1 other location - About 1 hr to fix
          aurelia_project/tasks/process-markup.js on lines 5..8

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

          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

          export default function processMarkup() {
            return gulp.src(project.markupProcessor.source, {sourcemaps: true, since: gulp.lastRun(processMarkup)})
              .pipe(build.bundle());
          }
          Severity: Major
          Found in aurelia_project/tasks/process-markup.js and 1 other location - About 1 hr to fix
          aurelia_project/tasks/process-css.js on lines 5..8

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

          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

              attached() {
                this.ea.subscribe('navchange', navstruct => this.updatenav(navstruct));
                this.ea.subscribe('hashchange', hashstruct => this.updatetitles(hashstruct));
              }
          Severity: Major
          Found in src/elements/markdown-top-nav.js and 1 other location - About 1 hr to fix
          src/elements/markdown-bottom-nav.js on lines 23..26

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

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

          Dygraph.prototype.drawGraph_ = function() {
              var start = new Date();
          
              // This is used to set the second parameter to drawCallback, below.
              var is_initial_draw = this.is_initial_draw_;
          Severity: Minor
          Found in src/utils/dygraph.js - About 1 hr to fix

            Function startTouch has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Dygraph.Interaction.startTouch = function(event, g, context) {
                event.preventDefault();  // touch browsers are all nice.
                var touches = [];
                for (var i = 0; i < event.touches.length; i++) {
                    var t = event.touches[i];
            Severity: Minor
            Found in src/utils/dygraph.js - About 1 hr to fix

              Function _dashedLine has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              DygraphCanvasRenderer.prototype._dashedLine = function(ctx, x, y, x2, y2, pattern) {
                  // Original version http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas
                  // Modified by Russell Valentine to keep line history and continue the pattern
                  // where it left off.
                  var dx, dy, len, rot, patternIndex, segment;
              Severity: Minor
              Found in 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 attr_ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              Dygraph.prototype.attr_ = function(name, seriesName) {
              
                  var sources = [];
                  sources.push(this.attrs_);
                  if (this.user_attrs_) {
              Severity: Minor
              Found in 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 numDateTicks has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              Dygraph.numDateTicks = function(start_time, end_time, granularity) {
                  if (granularity < Dygraph.MONTHLY) {
                      // Generate one tick mark for every fixed interval of time.
                      var spacing = Dygraph.SHORT_SPACINGS[granularity];
                      return Math.floor(0.5 + 1.0 * (end_time - start_time) / spacing);
              Severity: Minor
              Found in 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 computePlotArea_ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              DygraphLayout.prototype.computePlotArea_ = function() {
                  var area = {
                      // TODO(danvk): per-axis setting.
                      x: 0,
                      y: 0
              Severity: Minor
              Found in 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 addAnnotationRule has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              Dygraph.addAnnotationRule = function() {
                  if (Dygraph.addedAnnotationCSS) return;
              
                  var rule = "border: 1px solid black; " +
                      "background-color: white; " +
              Severity: Minor
              Found in 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 dateParser has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              Dygraph.dateParser = function(dateStr) {
                  var dateStrSlashed;
                  var d;
              
                  // Let the system try the format first, with one caveat:
              Severity: Minor
              Found in 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 constructor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  constructor(httpclient) {
                      this.client = httpclient;
                      this.handleTick = () => {
                          if (this.started) {
                              //do periodic stuff
              Severity: Minor
              Found in src/elements/remote-value.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 deregisterInputs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                deregisterInputs() {
                  //do removeListeners()
                  if (this.inputs) {
                    let inputparts = this.inputs.split(';');
                    for (let inputpart of inputparts) {
              Severity: Minor
              Found in 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 bind has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  bind() {
                    if (this.w3class) {
                        this.activeclass= this.w3class+ ' '+this.activeclasstemplate;
                        this.inactiveclass= this.w3class+' '+this.inactiveclasstemplate;
                    } else {
              Severity: Minor
              Found in src/elements/tabs.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