Showing 55 of 167 total issues
Function replaceAnchors
has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring. Open
const replaceAnchors = (
value: unknown,
anchorDefinitions: AnchorDefinitions
// eslint-disable-next-line sonarjs/cognitive-complexity
): unknown => {
- 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 BranchCellContent
has 46 lines of code (exceeds 40 allowed). Consider refactoring. Open
> = cell => {
const {
row: {
original: { flatBranches = [] }
}
Function evaluate
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
const evaluate = <T extends string | number | boolean>(
valueToEvaluate: T,
operator: Operator,
filterValue: T
): boolean => {
Function getWebviewData
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
private async getWebviewData(): Promise<TPlotsData> {
const selectedRevisions = this.plots.getSelectedRevisionDetails()
const [
cliError,
Function TableHead
has a Cognitive Complexity of 10 (exceeds 6 allowed). Consider refactoring. Open
export const TableHead = ({
columnOrder,
headerGroups,
setColumnOrder,
root,
- 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 TableRow
has a Cognitive Complexity of 10 (exceeds 6 allowed). Consider refactoring. Open
> = ({ row, isExpanded, className }): JSX.Element => {
const changes = useSelector(
(state: ExperimentsState) => state.tableData.changes
)
const dispatch = useDispatch()
- 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 ColumnResizer
has a Cognitive Complexity of 9 (exceeds 6 allowed). Consider refactoring. Open
export const ColumnResizer: React.FC<ColumnResizerProps> = ({
columnIsResizing,
resizerHeight,
setMenuSuppressed,
header
- 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 quickPickOne(
[...pipelines],
'Select a Pipeline to Run Command Against'
)
Avoid too many return
statements within this function. Open
return formatNumber(value)
Avoid too many return
statements within this function. Open
return String(value)
Avoid too many return
statements within this function. Open
return (
<div
data-testid="custom-plots"
id="custom-plots"
className={cx(styles.singleViewPlotsGrid, {
Avoid too many return
statements within this function. Open
return (
<EmptyState isFullScreen={false}>
<h1>Setup Complete</h1>
{children}
<p>
Avoid too many return
statements within this function. Open
return (
<EmptyState isFullScreen={false}>
<h1>Setup Complete</h1>
<IconButton
appearance="primary"
Function clickAndEnterProps
has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring. Open
} = (handler, textsForSelection = [], checkForTooltip = false) => ({
onClick: e => {
if (
isSelecting(textsForSelection) ||
(checkForTooltip && isTooltip(e.target as HTMLElement, ['BODY']))
- 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 collectFromParamsFile
has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring. Open
const collectFromParamsFile = (
acc: { path: string; value: Value | undefined }[],
key: string | undefined,
value: Value | ValueTree,
ancestors: 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"