creative-connections/Bodylight.js-Components

View on GitHub

Showing 430 of 684 total issues

Function destroy has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.prototype.destroy = function() {
    var removeRecursive = function(node) {
        while (node.hasChildNodes()) {
            removeRecursive(node.firstChild);
            node.removeChild(node.firstChild);
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

    Function treatMouseOpAsClick has 27 lines of code (exceeds 25 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

      Function createZoomHandles_ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      DygraphRangeSelector.prototype.createZoomHandles_ = function() {
          var img = new Image();
          img.className = 'dygraph-rangesel-zoomhandle';
          img.style.position = 'absolute';
          img.style.zIndex = 10;
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

        Function updatetitles has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          updatetitles(hashstruct) {
              //this.currentlink
              console.log('top nav hash:', hashstruct);
              if (window.markdownnav) {
                let currentlink = '#' + (hashstruct[0].length > 0 ? hashstruct[0] : this.index);
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/markdown-top-nav.js - About 1 hr to fix

          Function attached has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            attached() {
              //console.log('bdlmarkdownaurelia attached() src:', this.src);
              // eslint-disable-next-line new-cap
              //optionally, register customevent handler for 'contentupdate' when fromid is defined
              // eslint-disable-next-line new-cap
          Severity: Minor
          Found in src_aurelia-bodylight-plugin/src/elements/markdownaurelia.js - About 1 hr to fix

            Function convertf2a has 26 lines of code (exceeds 25 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

              Function handleValueChange has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.handleValueChange = e => {
                    let datapoint = [];
                    if (!this.xy) datapoint.push(e.detail.time);
                    //e.detail do not reallocate - using same buffer, thus slicing to append to data array
                    let edata = e.detail.data.slice();
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/elements/dygraphchart.js - About 1 hr to fix

                Function toc_body has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  md.renderer.rules.toc_body = function(tokens, index) {
                    let results = [];
                    let previousLevel = 0;
                
                    for (let i = 0; i < headingInfos.length; i++) {
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-btoc.js - About 1 hr to fix

                  Function _drawSeries has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      ctx, iter, strokeWidth, pointSize, drawPoints, drawGapPoints,
                      stepPlot, strategy) {
                  Severity: Major
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

                    Function drawZoomRect_ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    Dygraph.prototype.drawZoomRect_ = function(direction, startX, endX, startY,
                                                               endY, prevDirection, prevEndX,
                                                               prevEndY) {
                    Severity: Major
                    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

                      Function DrawPolygon_ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      Dygraph.DrawPolygon_ = function(sides, rotationRadians, ctx, cx, cy, color, radius, delta) {
                      Severity: Major
                      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

                        Function setAnnotations has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        DygraphLayout.prototype.setAnnotations = function(ann) {
                            // The Dygraph object's annotations aren't parsed. We parse them here and
                            // save a copy. If there is no parser, then the user must be using raw format.
                            this.annotations = [];
                            var parse = this.attr_('xValueParser') || function(x) { return x; };
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 55 mins 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 startPan has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Dygraph.Interaction.startPan = function(event, g, context) {
                            var i, axis;
                            context.isPanning = true;
                            var xRange = g.xAxisRange();
                            context.dateRange = xRange[1] - xRange[0];
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 55 mins 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 findClosestPoint has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Dygraph.prototype.findClosestPoint = function(domX, domY) {
                            var minDist = Infinity;
                            var idx = -1;
                            var points = this.layout_.points;
                            var dist, dx, dy, point, closestPoint, closestSeries;
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 55 mins 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 exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = ({ production } = {}, {extractCss, analyze, tests, hmr, port, host } = {}) => ({
                          resolve: {
                            extensions: ['.js'],
                            modules: [srcDir, 'node_modules'],
                        
                        
                        Severity: Minor
                        Found in webpack.config.js - About 55 mins 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 findPosX has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Dygraph.findPosX = function(obj) {
                            var curleft = 0;
                            if(obj.offsetParent) {
                                var copyObj = obj;
                                while(1) {
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 55 mins 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 cascadeEvents_ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Dygraph.prototype.cascadeEvents_ = function(name, extra_props) {
                            if (!name in this.eventListeners_) return true;
                        
                            // QUESTION: can we use objects & prototypes to speed this up?
                            var e = {
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 55 mins 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 cleanArgs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function cleanArgs(args) {
                          const cleaned = [];
                          for (let i = 0, ii = args.length; i < ii; i++) {
                            if (args[i] === '--env' && i < ii - 1) {
                              const env = args[++i].toLowerCase();
                        Severity: Minor
                        Found in aurelia_project/tasks/build.js - About 55 mins 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 _evaluateLineTicks has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        DygraphLayout.prototype._evaluateLineTicks = function() {
                            var i, tick, label, pos;
                            this.xticks = [];
                            for (i = 0; i < this.xTicks_.length; i++) {
                                tick = this.xTicks_[i];
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 55 mins 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 evaluateWithError has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        DygraphLayout.prototype.evaluateWithError = function() {
                            this.evaluate();
                            if (!(this.attr_('errorBars') || this.attr_('customBars'))) return;
                        
                            // Copy over the error terms
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 55 mins 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