Showing 1,408 of 1,408 total issues
Function getFlowAndCircleColors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getFlowAndCircleColors(
inputColors: FlowAndCircleColors | undefined,
defaultFlowColorScheme: string[],
darkMode: boolean,
): FlowAndCircleColorsRGBA {
- 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 calculateIndicatorValues
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private calculateIndicatorValues(
rawData: SourcingRecordsWithIndicatorRawData,
tonnage: number,
): Map<INDICATOR_NAME_CODES, number> {
const map: Map<INDICATOR_NAME_CODES, number> = new Map();
- 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 updateState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
updateState({ oldProps, props, changeFlags }: Record<string, any>): void {
const { dataProvider, highlightedObject } = this.state || {};
if (!dataProvider) {
return;
}
- 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 Alerts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Alerts: React.FC<AlertsProps> = ({ className, items }: AlertsProps) => {
if (!items) return null;
if (Array.isArray(items) && !items.length) return null;
const alerts = Array.isArray(items) ? items : [items];
- 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 getLocationAreaColorsRGBA
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getLocationAreaColorsRGBA(
colors: LocationAreaColors | undefined,
darkMode: boolean,
): LocationAreaColorsRGBA {
const normalColor = (colors && colors.normal) || DEFAULT_LOCATION_AREA_COLOR;
- 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 buildQueryForImport
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
buildQueryForImport(nameCodes: INDICATOR_NAME_CODES[]): {
params: string;
query: string;
} {
const importQueryFields: string[] = [
- 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 getTimeGranularityForDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getTimeGranularityForDate(date: Date): TimeGranularity {
let prev = undefined;
for (const current of TIME_GRANULARITIES) {
const { interval } = current;
const floored = interval(date);
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async validate(sheet: SourcingDataSheet): Promise<any> {
const progressTracker: ValidationProgressTracker =
this.getProgressTracker(sheet);
const validationErrors: ImportTaskError[] = [];
- 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"