Showing 8 of 68 total issues
Function useEventBus
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
(set, get) => ({
eventBus: null,
connectionState: 'noEventBus',
error: null,
lastErrorMessage: 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 useUserConfig
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
create<UserConfigState>((set, get) => ({
userConfig: initialUserConfig,
addUser: (username, information) => {
if (!username) {
throw new TypeError("The string '' is not a valid username.");
- 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 AvatarMenu
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function AvatarMenu({ onStatusPress, onResetPress }: AvatarMenuProps) {
const history = useHistory();
const { auth, signOut } = useAuth(selector);
const handleAction = useCallback(
- 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 setPrefValue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
currentState: PreferencesState,
group: GroupSelector,
preference: PrefSelector,
key: 'value' | 'renderer',
value: any
Function buildRoute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function buildRoute(
routing: Routing,
page: ReactNode,
isAuthenticated: boolean
): ReactNode {
- 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 parseRouting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function parseRouting(componentName: string, obj: unknown): Routing {
if (obj == null) {
throw new TypeError(
`${componentName} is missing the 'routing' property. Please add one to continue.`
);
- 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 report
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
report({ event, logger }) {
let message: JsonSerializable | undefined;
if (event.type === 'buildStart') {
message = { type: 'buildStart' };
- 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 useNotifications
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
create<NotificationState>((set, get) => ({
notifications: [],
isMuted: false,
add: notifications => {
logger.debug('Add new notifications');
- 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"