mAAdhaTTah/brookjs

View on GitHub

Showing 36 of 74 total issues

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

export const reducer: EddyReducer<State, Action> = (
  state = initialState('/', null),
  action,
) => {
  switch (action.type) {
Severity: Minor
Found in packages/brookjs-cli/src/commands/TestCommand/Lint/reducer.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 runCommands has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const runCommands = <A extends Action>(
  run: ResultRight<A>[],
  dispatch: (action: A) => A,
) => {
  for (const cmd of run) {
Severity: Minor
Found in packages/brookjs-eddy/src/eddy.ts - 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 reducer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const reducer: EddyReducer<State, Action> = (
  state = initialState('/', null),
  action,
) => {
  switch (action.type) {
Severity: Minor
Found in packages/brookjs-cli/src/commands/TestCommand/Check/reducer.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 View has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const View: React.FC<State> = ({ status, paths, results, error }) => {
  switch (status) {
    case 'init':
    case 'globbing':
    case 'formatting':
Severity: Minor
Found in packages/brookjs-cli/src/commands/FormatCommand/index.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

Avoid too many return statements within this function.
Open

        return state;
Severity: Major
Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return {
            ...state,
            step: 'complete',
            result: action.payload.result,
          };
    Severity: Major
    Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return {
                ...state,
                step: 'cancelled',
              };
      Severity: Major
      Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return <Built results={props.results!} watch={!!props.watch} />;
        Severity: Major
        Found in packages/brookjs-cli/src/commands/BuildCommand/View.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return externalModules.includes(packageName);
          Severity: Major
          Found in rollup.config.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return null;
            Severity: Major
            Found in packages/brookjs-cli/src/commands/StartCommand/index.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return false;
              Severity: Major
              Found in rollup.config.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return state;
                Severity: Major
                Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return {
                          ...state,
                          step: 'error',
                          error: action.payload.error,
                        };
                  Severity: Major
                  Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return (
                          <BuildErrors watch={!!props.watch} errors={[...errors, ...warnings]} />
                        );
                    Severity: Major
                    Found in packages/brookjs-cli/src/commands/BuildCommand/View.tsx - About 30 mins to fix

                      Function View has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      }> = props => {
                        if (props.rc == null) {
                          return <RCNotLoaded />;
                        }
                      
                      
                      Severity: Minor
                      Found in packages/brookjs-cli/src/commands/BuildCommand/View.tsx - 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 jestPlugin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const jestPlugin = ({
                        Kefir,
                      }: {
                        Kefir: typeof import('kefir').default;
                      }): Helpers => {
                      Severity: Minor
                      Found in packages/brookjs-desalinate/src/jestPlugin.tsx - 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