Showing 8 of 22 total issues
Function parseArgs
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
parseArgs(args) {
if (!args || !args.length || args.length === 0) {
return new Error('At least one argument is necessary');
}
if (args.length > 3 || args.length === 2) {
- Read upRead up
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 listPrs
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
listPrs(repository, callback) {
if (arguments.length <= 1) {
throw new Error('At least one argument must be passed');
}
Function formatLabels
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const formatLabels = prLabels => {
const okMark = ':white_check_mark:';
const notOkMark = ':x:';
let out = '';
Function parseArgs
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parseArgs(args) {
if (!args || !args.length || args.length === 0) {
return new Error('At least one argument is necessary');
}
if (args.length > 3 || args.length === 2) {
Function formatLabels
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
const formatLabels = prLabels => {
const okMark = ':white_check_mark:';
const notOkMark = ':x:';
let out = '';
- Read upRead up
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 find
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
find() {
let searchString;
let callback = arguments[0];
if (arguments.length === 2) {
Avoid too many return
statements within this function. Open
Open
return undefined;
Avoid too many return
statements within this function. Open
Open
return new Error(`Unknown job for \`${ productName }\`: \`${ jobName }\``);