Showing 62 of 189 total issues
Avoid deeply nested control flow statements. Open
if (formatted.suffix) {
data[index].valueFormatted += formatted.suffix;
}
Avoid deeply nested control flow statements. Open
if (v !== 'all') {
aComposite.displayMode = DisplayModes[1].value;
}
Function constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(
width: number,
height: number,
numColumns: number,
numRows: number,
- 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
Avoid deeply nested control flow statements. Open
if (columnsUsed > maxColumnsUsed) {
maxColumnsUsed = columnsUsed;
}
Avoid deeply nested control flow statements. Open
if (aField.state) {
copiedField.state = Object.assign({}, aField.state);
}
Avoid deeply nested control flow statements. Open
for (let rowNum = 0; rowNum < rowsOfField; rowNum++) {
// only create a new field when the rowValue is not null
if (aFieldValues[rowNum] !== null) {
if (aField.state) {
copiedField.state = Object.assign({}, aField.state);
Function getTextSizeForWidth
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getTextSizeForWidth(text: string, font: any, width: number, minFontPx: number, maxFontPx: number) {
Function OverrideItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const OverrideItem: React.FC<OverrideItemProps> = (props) => {
const [metricHints, setMetricHints] = useState<CascaderOption[]>([]);
const [override, _setOverride] = useState(props.override);
const setOverride = (value: OverrideItemType) => {
- 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 getMappedValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getMappedValue(valueMappings: LegacyValueMapping[], value: any): LegacyValueMapping {
// intentional use of deprecated function for v8 compat
// eslint-disable-next-line deprecation/deprecation
const emptyResult = { type: LegacyMappingType.ValueToText, value: '', text: '', from: '', to: '', id: 0 };
if (!valueMappings?.length) {
- 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 addRangeToTextMappingText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const addRangeToTextMappingText = (
allValueMappings: ValueMapping[],
rangeToTextMapping: RangeMap,
value: TimeSeriesValue
) => {
- 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
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return allValueMappings.concat(valueToTextMapping);
Avoid too many return
statements within this function. Open
return vm.options.result;
Avoid too many return
statements within this function. Open
return vm.options.result;
Avoid too many return
statements within this function. Open
return { thresholdLevel: currentState, color: currentColor };
Avoid too many return
statements within this function. Open
return vm.options.result;
Avoid too many return
statements within this function. Open
return vm.options.result;
Avoid too many return
statements within this function. Open
return allValueMappings;
Avoid too many return
statements within this function. Open
return vm.options.result;
Function getWorstSeries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getWorstSeries(series1: PolystatModel, series2: PolystatModel): any {
let worstSeries = series1;
const series1ThresholdLevel = series1.thresholdLevel;
const series2ThresholdLevel = series2.thresholdLevel;
- 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"