Showing 41 of 111 total issues
Function useResourceLinks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useResourceLinks<
T extends MapDataToPropsParam = {},
D extends LinkOpts = TermOpts,
>(
subjects: LaxNode | Node[],
Function normalizeDataSubjects
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function normalizeDataSubjects(props: Partial<DataInvalidationProps>): SubjectType[] {
if (!(props.subject || props.dataSubjects)) {
return NO_SUBJECTS;
}
- 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 useRenderLoadingOrError
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function useRenderLoadingOrError(
props: TypableProps & TypableInjectedProps,
error?: Error,
): React.ReactElement<any> | null | undefined {
const lrs = useLRS();
- 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 calculate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const calculate = (
subject: Node,
resource: LaxIdentifier | LaxIdentifier[] | Query,
fields: Query | null,
): TargetTuple => {
- 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 orderedElementsOfList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function orderedElementsOfList(store: LinkedRenderStore<any>, listEntry: Node): NestedBoundData {
const list = [];
const nodes = [listEntry];
let next = listEntry;
while (next && next !== rdfx.nil) {
- 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 targetsChanged
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const targetsChanged = (previous: Targets, next: Targets): boolean => {
if (previous === next) {
return false;
}
- 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 createConnectedComponent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const createConnectedComponent = <P>(
propMap: DataToPropsMapping,
opts: LinkOpts,
wrappedComponent: React.ComponentType<P>,
) => React.forwardRef((props: P & PropertyWrappedProps, ref: React.Ref<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 useCalculatedViewWithState
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function useCalculatedViewWithState(
props: InjectedPropTypes,
lrs: LinkReduxLRSType,
error?: Error,
): React.ReactElement | null {
- 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 toJS
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function toJS(obj: Literal | unknown): ToJSOutputTypes {
if (!isLiteral(obj)) {
return obj as object;
}
- 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 !equals(previous, next);
Avoid too many return
statements within this function. Open
return !equals(previous, next);
Avoid too many return
statements within this function. Open
return Number(obj.value);
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return propertyRenderer(
renderChildrenOrValue(childProps, lrs),
associationRenderer,
);
Avoid too many return
statements within this function. Open
return arrayResolver(lrs, query);
Avoid too many return
statements within this function. Open
return propertyRenderer(wrapLOC, associationRenderer);
Avoid too many return
statements within this function. Open
return obj.value;
Avoid too many return
statements within this function. Open
return React.createElement(associationRenderer, associationProps, childComp);
Avoid too many return
statements within this function. Open
return undefined;