Showing 5 of 19 total issues
File utils.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var chalk = require('chalk');
var lo = require('lodash');
var jsonfile = require('jsonfile');
var moment = require('moment');
var Q = require('q');
- Create a ticketCreate a ticket
File sfdc.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var Q = require('q');
var csvtojson = require('csvtojson');
var fs = require('fs');
var jsonfile = require('jsonfile');
var jsforce = require('jsforce');
- Create a ticketCreate a ticket
Function printSummaryLine
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var printSummaryLine = function (data) {
if (lo.isUndefined(data.info.username)) {
global.printer.print(chalk.bold('User Id: ') + data.info.userid);
} else {
global.printer.print(chalk.bold('Username: ') + data.info.username + ' (' + data.info.userid + ')');
- Create a ticketCreate a ticket
Function filterResults
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var filterResults = function (logs) {
var deferred = Q.defer();
var results = [];
if (
- Create a ticketCreate a ticket
Function setupLogger
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
var setupLogger = function () {
if (isBunyanLogging()) {
var stream = { level: 'info' };
if (global.config.debug) {
- Read upRead up
- Create a ticketCreate a ticket
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"