creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 366 of 552 total issues

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

    Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    DygraphCanvasRenderer.prototype.render = function() {
        // Draw the new X/Y grid. Lines appear crisper when pixels are rounded to
        // half-integers. This prevents them from drawing in two rows/cols.
        var ctx = this.elementContext;
        function halfUp(x)  { return Math.round(x) + 0.5; }
    Severity: Minor
    Found in src/utils/dygraph.js - About 1 hr to fix

      Function createRotatedDiv has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function createRotatedDiv(axis, classes, html) {
              var box = {
                  left: 0,
                  top: that.area.y,
                  width: that.attr_('yLabelWidth'),
      Severity: Minor
      Found in src/utils/dygraph.js - About 1 hr to fix

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

          constructor() {
            this.params = '';
            console.log('WatchhashCore');
            //event listener function needs to be declared this way - they have access to 'this'
            this.handleHashChange = e => {
        Severity: Minor
        Found in src/attributes/watch-hash-core.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 attached has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            attached() {
              //register horizontal line drawing, shows difference line between appropriate points from dataset0 and dataset1
              Chart.pluginService.register({
                beforeDraw: function(chart, ease) {
                  if (chart.config.options.XYPlugin && chart.tooltip._active && chart.tooltip._active.length) {
        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 bind has a Cognitive Complexity of 14 (exceeds 5 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

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

            legend.prototype.activate = function(g) {
                var div;
                var divWidth = g.getOption('labelsDivWidth');
        
                var userLabelsDiv = g.getOption('labelsDiv');
        Severity: Minor
        Found in src/utils/dygraph.js - About 1 hr to fix

          Function generateLegendDashHTML has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var generateLegendDashHTML = function(strokePattern, color, oneEmWidth) {
                  // IE 7,8 fail at these divs, so they get boring legend, have not tested 9.
                  var isIE = (/MSIE/.test(navigator.userAgent) && !window.opera);
                  if (isIE) return "—";
          
          
          Severity: Minor
          Found in src/utils/dygraph.js - About 1 hr to fix

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

                attached() {
                    if (this.refpointindex) {
                        Chart.pluginService.register({
                            id: 'custom_lines to ref point',
                            afterDraw: (chart) => {
            Severity: Minor
            Found in src/elements/chartjs-fixed.js - About 1 hr to fix

              Function parseArray_ has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Dygraph.prototype.parseArray_ = function(data) {
                  // Peek at the first x value to see if it's numeric.
                  if (data.length === 0) {
                      this.error("Can't plot empty data set");
                      return null;
              Severity: Minor
              Found in src/utils/dygraph.js - About 1 hr to fix

                Function findStackedPoint has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Dygraph.prototype.findStackedPoint = function(domX, domY) {
                    var row = this.findClosestRow(domX);
                    var boundary = this.getLeftBoundary_();
                    var rowIdx = row - boundary;
                    var points = this.layout_.points;
                Severity: Minor
                Found in src/utils/dygraph.js - About 1 hr to fix

                  Function movePan has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Dygraph.Interaction.movePan = function(event, g, context) {
                      context.dragEndX = g.dragGetX_(event, context);
                      context.dragEndY = g.dragGetY_(event, context);
                  
                      var minDate = context.initialLeftmostDate -
                  Severity: Minor
                  Found in src/utils/dygraph.js - About 1 hr to fix

                    Function refresh has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    let refresh = debounce(() => {
                      if (isBuilding) {
                        log('Watcher: A build is already in progress, deferring change detection...');
                        return;
                      }
                    Severity: Minor
                    Found in aurelia_project/tasks/watch.js - About 1 hr to fix

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

                        Function beforeDraw has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                beforeDraw: function(chart, ease) {
                                  if (chart.config.options.XYPlugin && chart.tooltip._active && chart.tooltip._active.length) {
                                    let activePoint = chart.tooltip._active[0];
                                    //console.log('chart horizontal line debug chart activepoint:', activePoint);
                                    let ctx = chart.ctx;
                        Severity: Minor
                        Found in src/elements/chartjs-xy-points.js - About 1 hr to fix

                          Function registerInputs has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            registerInputs(){
                              if (this.inputs) { //register DOM elements to listen to their 'change' event directly
                                let inputparts = this.inputs.split(';'); //splits groups delimited by ;
                                this.inputreferences = [];
                                for (let inputpart of inputparts) {
                          Severity: Minor
                          Found in src/elements/fmi.js - About 1 hr to fix

                            Function initAdobe has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                initAdobe() {
                                  console.log('animateadobe initAdobe()');
                                  //search for composition which has the 'name' in library
                                  for (let cid of Object.keys(window.AdobeAn.compositions)) {
                                    let comp = window.AdobeAn.getComposition(cid);
                            Severity: Minor
                            Found in src/elements/animate-adobe.js - About 1 hr to fix

                              Function beforeDraw has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      beforeDraw: function(chart, easing) {
                                        if (chart.config.options.section && chart.config.options.section.length > 0) {
                                          let ctx = chart.chart.ctx;
                                          let chartArea = chart.chartArea;
                                          let meta = chart.getDatasetMeta(0);
                              Severity: Minor
                              Found in src/elements/chartjs.js - About 1 hr to fix

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

                                  attached() {
                                    //listening to custom event fmidata
                                    console.log('dygraph attached');
                                    if (this.refindex && (this.refindex.indexOf(',')>0)) this.refindices = this.refindex.split(',');
                                    let fmielement = document.getElementById(this.fromid);
                                Severity: Minor
                                Found in src/elements/dygraphchart.js - About 1 hr to fix

                                  Function moveTouch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  Dygraph.Interaction.moveTouch = function(event, g, context) {
                                      var i, touches = [];
                                      for (i = 0; i < event.touches.length; i++) {
                                          var t = event.touches[i];
                                          touches.push({
                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language