creative-connections/Bodylight.js-Components

View on GitHub

Showing 430 of 684 total issues

Function list_item_open has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    this.mdtoc.renderer.rules.list_item_open = function(tokens, idx, options, env, slf) {
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/markdownnav.js - About 35 mins to fix

    Function bullet_list_open has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        this.mdtoc.renderer.rules.bullet_list_open = function(tokens, idx, options, env, slf) {
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/markdownnav.js - About 35 mins to fix

      Function bullet_list_close has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          this.mdtoc.renderer.rules.bullet_list_close = function(tokens, idx, options, env, slf) { if (window.markdownnavdepth) window.markdownnavdepth--; return '</ul>';};
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/markdownnav.js - About 35 mins to fix

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

          bind() {
            console.log('watchhash check au controller');
            if (this.element && this.element.au && this.element.au.controller) {
              console.log('watchhash check au controller type:', typeof (this.element.au.controller));
              if (typeof (this.element.au.controller) === 'object') console.log('watchhash check au controller viewmodel:', this.element.au.controller.viewModel);
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/attributes/watchhash.js - About 35 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 drawGraph_ has a Cognitive Complexity of 7 (exceeds 5 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_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.update = function (self, o) {
            if (typeof(o) != 'undefined' && o !== null) {
                for (var k in o) {
                    if (o.hasOwnProperty(k)) {
                        self[k] = o[k];
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 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 unstackPointAtIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        DygraphLayout.prototype.unstackPointAtIndex = function(idx) {
            var point = this.points[idx];
            // If the point is missing, no unstacking is necessary
            if (!point.yval) {
                return point;
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 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 isValidPoint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.isValidPoint = function(p, allowNaNY) {
            if (!p) return false; // null or undefined object
            if (p.yval === null) return false; // missing point
            if (p.x === null || p.x === undefined) return false;
            if (p.y === null || p.y === undefined) return false;
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          constructor(element, ea) {
            //super();
            this.element = element;
            this.isReadMDCustomElement = false;
            console.log('watchhash check au controller');
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/attributes/watchhashchange.js - About 35 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 V has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        Date.ext={};Date.ext.util={};Date.ext.util.xPad=function(x,pad,r){if(typeof (r)=="undefined"){r=10}for(;parseInt(x,10)<r&&r>1;r/=10){x=pad.toString()+x}return x.toString()};Date.prototype.locale="en-GB";if(document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){Date.prototype.locale=document.getElementsByTagName("html")[0].lang}Date.ext.locales={};Date.ext.locales.en={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%T"};Date.ext.locales["en-US"]=Date.ext.locales.en;Date.ext.locales["en-US"].c="%a %d %b %Y %r %Z";Date.ext.locales["en-US"].x="%D";Date.ext.locales["en-US"].X="%r";Date.ext.locales["en-GB"]=Date.ext.locales.en;Date.ext.locales["en-AU"]=Date.ext.locales["en-GB"];Date.ext.formats={a:function(d){return Date.ext.locales[d.locale].a[d.getDay()]},A:function(d){return Date.ext.locales[d.locale].A[d.getDay()]},b:function(d){return Date.ext.locales[d.locale].b[d.getMonth()]},B:function(d){return Date.ext.locales[d.locale].B[d.getMonth()]},c:"toLocaleString",C:function(d){return Date.ext.util.xPad(parseInt(d.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(d){return Date.ext.util.xPad(parseInt(Date.ext.util.G(d)/100,10),0)},G:function(d){var y=d.getFullYear();var V=parseInt(Date.ext.formats.V(d),10);var W=parseInt(Date.ext.formats.W(d),10);if(W>V){y++}else{if(W===0&&V>=52){y--}}return y},H:["getHours","0"],I:function(d){var I=d.getHours()%12;return Date.ext.util.xPad(I===0?12:I,0)},j:function(d){var ms=d-new Date(""+d.getFullYear()+"/1/1 GMT");ms+=d.getTimezoneOffset()*60000;var doy=parseInt(ms/60000/60/24,10)+1;return Date.ext.util.xPad(doy,0,100)},m:function(d){return Date.ext.util.xPad(d.getMonth()+1,0)},M:["getMinutes","0"],p:function(d){return Date.ext.locales[d.locale].p[d.getHours()>=12?1:0]},P:function(d){return Date.ext.locales[d.locale].P[d.getHours()>=12?1:0]},S:["getSeconds","0"],u:function(d){var dow=d.getDay();return dow===0?7:dow},U:function(d){var doy=parseInt(Date.ext.formats.j(d),10);var rdow=6-d.getDay();var woy=parseInt((doy+rdow)/7,10);return Date.ext.util.xPad(woy,0)},V:function(d){var woy=parseInt(Date.ext.formats.W(d),10);var dow1_1=(new Date(""+d.getFullYear()+"/1/1")).getDay();var idow=woy+(dow1_1>4||dow1_1<=1?0:1);if(idow==53&&(new Date(""+d.getFullYear()+"/12/31")).getDay()<4){idow=1}else{if(idow===0){idow=Date.ext.formats.V(new Date(""+(d.getFullYear()-1)+"/12/31"))}}return Date.ext.util.xPad(idow,0)},w:"getDay",W:function(d){var doy=parseInt(Date.ext.formats.j(d),10);var rdow=7-Date.ext.formats.u(d);var woy=parseInt((doy+rdow)/7,10);return Date.ext.util.xPad(woy,0,10)},y:function(d){return Date.ext.util.xPad(d.getFullYear()%100,0)},Y:"getFullYear",z:function(d){var o=d.getTimezoneOffset();var H=Date.ext.util.xPad(parseInt(Math.abs(o/60),10),0);var M=Date.ext.util.xPad(o%60,0);return(o>0?"-":"+")+H+M},Z:function(d){return d.toString().replace(/^.*\(([^)]+)\)$/,"$1")},"%":function(d){return"%"}};Date.ext.aggregates={c:"locale",D:"%m/%d/%y",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"};Date.ext.aggregates.z=Date.ext.formats.z(new Date());Date.ext.aggregates.Z=Date.ext.formats.Z(new Date());Date.ext.unsupported={};Date.prototype.strftime=function(fmt){if(!(this.locale in Date.ext.locales)){if(this.locale.replace(/-[a-zA-Z]+$/,"") in Date.ext.locales){this.locale=this.locale.replace(/-[a-zA-Z]+$/,"")}else{this.locale="en-GB"}}var d=this;while(fmt.match(/%[cDhnrRtTxXzZ]/)){fmt=fmt.replace(/%([cDhnrRtTxXzZ])/g,function(m0,m1){var f=Date.ext.aggregates[m1];return(f=="locale"?Date.ext.locales[d.locale][m1]:f)})}var str=fmt.replace(/%([aAbBCdegGHIjmMpPSuUVwWyY%])/g,function(m0,m1){var f=Date.ext.formats[m1];if(typeof (f)=="string"){return d[f]()}else{if(typeof (f)=="function"){return f.call(d,d)}else{if(typeof (f)=="object"&&typeof (f[0])=="string"){return Date.ext.util.xPad(d[f[0]](),f[1])}else{return m1}}}});d=null;return str};
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 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 setDefaultAnswer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            setDefaultAnswer(qid2) {
                let qid = qid2;
                if (qid2.includes(';')) qid = qid2.split(';')[0]; //first is id second is id of related tabs
                if (this.quizids.includes(qid2)) {
                    // Check if an item with id 'id2' exists
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/quiz-summary.js - About 35 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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          constructor() {
            super();    
            this.customBackgroundPlugin = {
              beforeDatasetsDraw: function(chart, easing) {
                const acidbaseannotation = [[7.4,40,"Normal area"],
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/chartjs-xy-sachart.js - About 35 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 updateData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          updateData(e) {
            let j = 0;
            for (let i = this.refindex; i < this.refindex + this.refvalues; i++) {
              //adds data to datasets
        
        
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/plotly.js - About 35 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 attached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            attached() {
                let maxlength = 4 + this.max.length + ((this.step && this.step.toString().includes('.')) ? this.step.toString().length : 1);
                this.refnumber.style = 'width:' + maxlength + 'ch';
                if (this.fromid) {
                    if (this.operation.length == 0) {
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/range.js - About 35 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 handleKeyboardInput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        handleKeyboardInput(e) {
          if (e.key >= 0 && e.key <= 9) this.appendNumber(e.key)
          if (e.key === '.') this.appendPoint()
          if (e.key === '=' || e.key === 'Enter') this.evaluate()
          if (e.key === 'Backspace') this.deleteNumber()
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/calculator.js - About 35 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 open has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            open(newid) {
              if (this.active) {
                this.setinactive(this.active);
                this.setactive(newid);
                this.active = newid;
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/tabs.js - About 35 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 startstop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            startstop() {
              console.log('animateadobecontrol startstop()', this);
              if (!this.onetime && !this.animationstarted) {
                  //animate-adobe component playafterstart=false - start it once
                  window.ani.startAllAnimation();
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe-control.js - About 35 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 bind has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            bind() {
              if (this.fromid) {
                let fromel = document.getElementById(this.fromid);
                if (fromel) {
                  this.registerAnimateEvents(fromel);
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 35 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 updatevalue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            updatevalue() {
              if (this.value == this.thresholdvalue) {  //convert and compare - string "2" == 2
                if (!this.triggered) {
                  this.triggered = true;
                  this.trigger();
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/buttonparams.js - About 35 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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            constructor(httpclient) {
                this.client = httpclient;
                // Method to handle each tick
                this.handleTick = () => {            
                    this.get();
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/remote-value.js - About 35 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