Showing 605 of 958 total issues
Function combins
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static combins(n: number, r: number): number {
let maxDenom;
let minDenom;
if (n - r > r) {
minDenom = r;
- 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 createDecoder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function createDecoder(information: BitArray): AbstractExpandedDecoder {
try {
if (information.get(1)) {
return new AI01AndOtherAIs(information);
- 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 getStandardUPCEANChecksum
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static getStandardUPCEANChecksum(s: string): number {
let length = s.length;
let sum = 0;
for (let i = length - 1; i >= 0; i -= 2) {
let digit = s.charAt(i).charCodeAt(0) - '0'.charCodeAt(0);
- 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 validateQuietZone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private validateQuietZone(row: BitArray, startPattern: number): void {
let quietCount: number = this.narrowLineWidth * 10; // expect to find this many pixels of quiet zone
// if there are not so many pixel at all let's try as many as possible
- 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 determineNumSysAndCheckDigit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static determineNumSysAndCheckDigit(resultString: StringBuilder, lgPatternFound: int): void {
for (let numSys: int = 0; numSys <= 1; numSys++) {
for (let d: int = 0; d < 10; d++) {
if (lgPatternFound === this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[numSys][d]) {
- 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"