Showing 266 of 572 total issues
Function isValidChangeCommand
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected isValidChangeCommand(command: ICommandCapture, stateName: string): boolean {
if (command.name === "enable" || command.name === "disable") {
return command.commandArguments[0] === WebGlConstants.STENCIL_TEST.value;
}
if (command.name === "stencilOp" || command.name === "stencilOpSeparate") {
- 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 stringifyArgs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected stringifyArgs(args: IArguments): string[] {
const stringified = [];
for (let i = 0; i < args.length; i++) {
const arg = args[i];
- 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 isValidChangeCommand
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected isValidChangeCommand(command: ICommandCapture, stateName: string): boolean {
if (command.name === "enable" || command.name === "disable") {
if (command.commandArguments[0] === WebGlConstants.SAMPLE_COVERAGE.value) {
return stateName === WebGlConstants.SAMPLE_COVERAGE.name;
}
- 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 getCommandNameToStates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private getCommandNameToStates(): { [key: string]: string[] } {
const result: { [key: string]: string[] } = {};
for (const stateName in this.changeCommandsByState) {
if (this.changeCommandsByState.hasOwnProperty(stateName)) {
for (const changeCommand of this.changeCommandsByState[stateName]) {
- 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 getUboValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getUboValue(bindingPoint: number, offset: number, size: number, type: number): any {
const uboType = DrawCallUboInputState.uboTypes[type];
if (!uboType) {
return undefined;
}
- 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 merge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function merge<T, U>(first: T, second: U): T & U {
const result: any = {};
for (const id in first) {
if (first.hasOwnProperty(id)) {
result[id] = first[id];
- 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"