creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 366 of 552 total issues

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/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 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/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 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/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 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/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/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

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

  bind() {
    //either badges are defined - images in slot, or images are defined
    //badges = 5, defines number of dots/badges generated
    //create items array - numbers from 0 to 'badges -1'
    if (this.badges) {
Severity: Minor
Found in src/elements/carousel.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 start_ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.prototype.start_ = function() {
    var data = this.file_;

    // Functions can return references of all other types.
    if (typeof data == 'function') {
Severity: Minor
Found in src/utils/dygraph.js - About 1 hr to fix

    Function mouseMove_ has 31 lines of code (exceeds 25 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/utils/dygraph.js - About 1 hr to fix

      Function resize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Dygraph.prototype.resize = function(width, height) {
          if (this.resize_lock) {
              return;
          }
          this.resize_lock = true;
      Severity: Minor
      Found in src/utils/dygraph.js - About 1 hr to fix

        Function footnoteInline has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function footnoteInline(state, silent) {
            let labelStart;
            let labelEnd;
            let footnoteId;
            let token;
        Severity: Minor
        Found in src/elements/markdown-it-bfootnote.js - About 1 hr to fix

          Function bind has 31 lines of code (exceeds 25 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/elements/pdb-pdbe-molstar.js - About 1 hr to fix

            Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                constructor() {
                  this.handleTick = e => {
                    this.currenttick++;
                    if (this.currenttick >= this.ticks2reset) {
                      //do reset values
            Severity: Minor
            Found in src/elements/buttonparams.js - About 1 hr to fix

              Function bind has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                bind() {
                  //console.log('bdlmarkdownnav src:', this.src);
                  if (this.notinitread && this.src && this.src.length > 0 && this.mdtoc) this.fetchMDSrc();
                  //bind navigation first - get src before content - to solve navigation hide open issue at the beginning
                  //console.log('bdlmakrdownnav src:', this.src);
              Severity: Minor
              Found in src/elements/markdownnav.js - About 1 hr to fix

                Function extremeValues_ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Dygraph.prototype.extremeValues_ = function(series) {
                    var minY = null, maxY = null, j, y;
                
                    var bars = this.attr_("errorBars") || this.attr_("customBars");
                    if (bars) {
                Severity: Minor
                Found in src/utils/dygraph.js - About 1 hr to fix

                  Function DygraphCanvasRenderer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var DygraphCanvasRenderer = function(dygraph, element, elementContext, layout) {
                      this.dygraph_ = dygraph;
                  
                      this.layout = layout;
                      this.element = element;
                  Severity: Minor
                  Found in src/utils/dygraph.js - About 1 hr to fix

                    Function bind has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      bind() {
                        this.refindex = parseInt(this.refindex, 10);
                        this.refvalues = parseInt(this.refvalues, 10);
                        this.refendindex = this.refindex + this.refvalues;
                    
                    
                    Severity: Minor
                    Found in src/elements/plotly.js - About 1 hr to fix

                      Function updateOptions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Dygraph.prototype.updateOptions = function(input_attrs, block_redraw) {
                          if (typeof(block_redraw) == 'undefined') block_redraw = false;
                      
                          // mapLegacyOptions_ drops the "file" parameter as a convenience to us.
                          var file = input_attrs.file;
                      Severity: Minor
                      Found in src/utils/dygraph.js - About 1 hr to fix

                        Function bind has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          bind() {
                            //register throttled update function    
                            if (typeof this.throttle === 'string') this.throttle = parseInt(this.throttle, 10);
                            if (typeof this.dataevent === 'string') this.dataevent = this.dataevent === 'true';
                            if (typeof this.precision === 'string') this.precision = parseInt(this.precision, 10);
                        Severity: Minor
                        Found in src/elements/value.js - About 1 hr to fix

                          Function _drawStyledLine has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              ctx, i, setName, color, strokeWidth, strokePattern, drawPoints,
                              drawPointCallback, pointSize) {
                          Severity: Major
                          Found in src/utils/dygraph.js - About 1 hr to fix

                            Function getScript has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              getScript(source, callback) {
                                //check whether the script is not already there
                                if (Array.from(document.getElementsByTagName('script')).filter(x=> x.getAttribute('src') === source).length > 0) {
                                  console.log('fmi.getScript() WARNING, script is already added into DOM:', source);
                                  //do callback?
                            Severity: Minor
                            Found in src/elements/fmi.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language