18F/standup-slack-bot

View on GitHub

Showing 54 of 66 total issues

Function 1 has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
/**
 * lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
Severity: Minor
Found in lib/web/static/uswds/js/uswds.js - About 2 days 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

File uswds.js has 811 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
/**
 * lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
Severity: Major
Found in lib/web/static/uswds/js/uswds.js - About 1 day to fix

    Function handleQueuedItem has 227 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function handleQueuedItem(dequeuedObject, taskFinished) {
      const bot = dequeuedObject.bot;
      const interviewUser = dequeuedObject.interviewUser;
      const interviewChannel = dequeuedObject.interviewChannel;
      const singleSection = dequeuedObject.singleSection;
    Severity: Major
    Found in lib/helpers/doInterview.js - About 1 day to fix

      Function 2 has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      },{}],2:[function(require,module,exports){
      (function( w ){
          "use strict";
      
          var Politespace = function( element ) {
      Severity: Minor
      Found in lib/web/static/uswds/js/uswds.js - About 6 hrs 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 1 has 147 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
      (function (global){
      /**
       * lodash (Custom Build) <https://lodash.com/>
       * Build: `lodash modularize exports="npm" -o ./`
      Severity: Major
      Found in lib/web/static/uswds/js/uswds.js - About 5 hrs to fix

        Function 2 has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{}],2:[function(require,module,exports){
        (function( w ){
            "use strict";
        
            var Politespace = function( element ) {
        Severity: Major
        Found in lib/web/static/uswds/js/uswds.js - About 4 hrs to fix

          Function 17 has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          },{"../../../node_modules/politespace/src/politespace":2,"../utils/verify-jquery":24}],17:[function(require,module,exports){
          /**
           * This file defines key ECMAScript 5 methods that are used by the Standards
           * but may be missing in older browsers.
           */
          Severity: Minor
          Found in lib/web/static/uswds/js/uswds.js - About 4 hrs 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 doBlock has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function doBlock(bot, message, blockChannel, blockUser) {
            log.verbose('Got user standup info:\n' + message.match[0]);
          
            var localReport = '';
            var content = message.match[4];
          Severity: Major
          Found in lib/helpers/doBlock.js - About 4 hrs to fix

            Function debounce has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function debounce(func, wait, options) {
              var lastArgs,
                  lastThis,
                  maxWait,
                  result,
            Severity: Major
            Found in lib/web/static/uswds/js/uswds.js - About 3 hrs to fix

              Function up has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                up: function (queryInterface, Sequelize) {
                  /*
                    Add altering commands here.
                    Return a promise to correctly handle asynchronicity.
              
              
              Severity: Major
              Found in migrations/20160315145654-create-model.js - About 3 hrs to fix

                Function userReport has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function userReport(bot, message) {
                  log.verbose('Got a request for a user report');
                  var channel = /<#C\w+>/.test(message.text) ? message.text.match(/<#(C\w+)>/)[1] : message.channel;
                  var user = /<@U\w+>/.test(message.text) ? message.text.match(/<@(U\w+)>/)[1] : message.user;
                  var days = /\s\d+(\s|$)/.test(message.text) ? message.text.match(/\s(\d+)(\s|$)/)[1] : 7;
                Severity: Major
                Found in lib/bot/userReport.js - About 2 hrs to fix

                  `` has 25 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                  (function (global){
                  /**
                   * lodash (Custom Build) <https://lodash.com/>
                   * Build: `lodash modularize exports="npm" -o ./`
                  Severity: Minor
                  Found in lib/web/static/uswds/js/uswds.js - About 2 hrs to fix

                    Function 10 has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    },{"../utils/select":23,"./toggle-field-mask":8}],10:[function(require,module,exports){
                    var select = require('../utils/select');
                    var addClass = require('../utils/add-class');
                    var removeClass = require('../utils/remove-class');
                    var dispatch = require('../utils/dispatch');
                    Severity: Minor
                    Found in lib/web/static/uswds/js/uswds.js - About 2 hrs 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

                    File doInterview.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    'use strict';
                    
                    var log = require('../../getLogger')('interview recorder');
                    var models = require('../../models');
                    var moment = require('moment');
                    Severity: Minor
                    Found in lib/helpers/doInterview.js - About 2 hrs to fix

                      Function e has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                      Severity: Minor
                      Found in lib/web/static/uswds/js/uswds.js - About 2 hrs 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 21 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{}],21:[function(require,module,exports){
                      /**
                       * Attaches a given listener function to a given element which is
                       * triggered by a specified list of event types.
                       * @param {HTMLElement} element - the element to which the listener will be attached
                      Severity: Minor
                      Found in lib/web/static/uswds/js/uswds.js - About 2 hrs 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 25 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{}],25:[function(require,module,exports){
                      /*
                       * @name DOMLoaded
                       * @param {function} cb - The callback function to run when the DOM has loaded.
                       */
                      Severity: Minor
                      Found in lib/web/static/uswds/js/uswds.js - About 2 hrs 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 3 has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      },{}],3:[function(require,module,exports){
                      var select = require('../utils/select');
                      
                      /**
                       * @name showPanelListener
                      Severity: Major
                      Found in lib/web/static/uswds/js/uswds.js - About 2 hrs to fix

                        Function 5 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        },{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],5:[function(require,module,exports){
                        var select = require('../utils/select');
                        var addClass = require('../utils/add-class');
                        var removeClass = require('../utils/remove-class');
                        var dispatch = require('../utils/dispatch');
                        Severity: Minor
                        Found in lib/web/static/uswds/js/uswds.js - About 1 hr to fix

                          Function 7 has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          },{"../../utils/add-class":20,"../../utils/dispatch":21,"../../utils/remove-class":22,"../../utils/select":23}],7:[function(require,module,exports){
                          var select = require('../../utils/select');
                          var addClass = require('../../utils/add-class');
                          var removeClass = require('../../utils/remove-class');
                          var dispatch = require('../../utils/dispatch');
                          Severity: Minor
                          Found in lib/web/static/uswds/js/uswds.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language