wuespace/telestion-client

View on GitHub

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,
Severity: Minor
Found in packages/telestion-client-core/src/hooks/stores/use-event-bus.ts - About 1 hr to fix

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.");

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(

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
Severity: Minor
Found in packages/telestion-client-core/src/hooks/stores/use-preferences.ts - About 35 mins to fix

    Function buildRoute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    export function buildRoute(
        routing: Routing,
        page: ReactNode,
        isAuthenticated: boolean
    ): ReactNode {
    Severity: Minor
    Found in packages/telestion-client-core/src/components/pages/lib/build-route.tsx - About 35 mins to fix

    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.`
            );
    Severity: Minor
    Found in packages/telestion-client-core/src/components/pages/lib/parse-routing.ts - About 25 mins to fix

    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' };
    Severity: Minor
    Found in packages/parcel-reporter-tc-cli/src/reporter.ts - About 25 mins to fix

    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');
    Severity: Minor
    Found in packages/telestion-client-core/src/hooks/stores/use-notifications.ts - About 25 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language