mAAdhaTTah/brookjs

View on GitHub

Showing 71 of 74 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const project$ = projectDelta(
action$.thru(ofType(actions.initialize.request)),
state$.map(({ project }) => project),
);
Severity: Minor
Found in packages/brookjs-cli/src/commands/StartCommand/index.tsx and 1 other location - About 45 mins to fix
packages/brookjs-cli/src/commands/StartCommand/index.tsx on lines 65..68

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Given('I append to {string} with contents', async function(
path: string,
contents: string
) {
await this.appendFile({ path, contents: addEOL(contents) });
Severity: Minor
Found in packages/brookjs-cli/features/support/steps.ts and 1 other location - About 45 mins to fix
packages/brookjs-cli/features/support/steps.ts on lines 65..70

Similar blocks of code found in 2 locations. Consider refactoring.
Open

case 'FAILED':
// CREATED should only be emitted from creating step
if (state.step !== 'creating') {
return state;
}
Severity: Minor
Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts and 1 other location - About 40 mins to fix
packages/brookjs-cli/src/commands/NewCommand/reducer.ts on lines 99..109

Similar blocks of code found in 2 locations. Consider refactoring.
Open

case 'CREATED':
// CREATED should only be emitted from creating step
if (state.step !== 'creating') {
return state;
}
Severity: Minor
Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts and 1 other location - About 40 mins to fix
packages/brookjs-cli/src/commands/NewCommand/reducer.ts on lines 110..120

Similar blocks of code found in 2 locations. Consider refactoring.
Open

outputFile(file: File) {
return fs.outputFile(path.join(this.cwd, file.path), file.contents);
}
Severity: Minor
Found in packages/brookjs-cli/features/support/world.ts and 1 other location - About 40 mins to fix
packages/brookjs-cli/features/support/world.ts on lines 108..110

Similar blocks of code found in 2 locations. Consider refactoring.
Open

useEffect(() => {
const sub = loop$.observe(action$.emit);
 
return () => sub.unsubscribe();
}, [action$, loop$]);
Severity: Minor
Found in packages/brookjs-silt/src/useDelta.ts and 1 other location - About 40 mins to fix
packages/brookjs-silt/src/useDelta.ts on lines 71..75

Similar blocks of code found in 2 locations. Consider refactoring.
Open

appendFile(file: File) {
return fs.appendFile(path.join(this.cwd, file.path), file.contents);
}
Severity: Minor
Found in packages/brookjs-cli/features/support/world.ts and 1 other location - About 40 mins to fix
packages/brookjs-cli/features/support/world.ts on lines 104..106

Similar blocks of code found in 2 locations. Consider refactoring.
Open

useEffect(() => {
const sub = delta$.observe(action$.emit);
 
return () => sub.unsubscribe();
}, [action$, delta$]);
Severity: Minor
Found in packages/brookjs-silt/src/useDelta.ts and 1 other location - About 40 mins to fix
packages/brookjs-silt/src/useDelta.ts on lines 49..53

Function toEmitFromJunction has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

this: any,
element: any,
expected: any,
cb: (a: any, b: any, c: any) => void = noop,
{ timeLimit = 10000 } = {},
Severity: Minor
Found in packages/brookjs-desalinate/src/jestPlugin.tsx - About 35 mins to fix

    Function toEmitFromDelta has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    this: jest.MatcherContext,
    delta: any,
    expected: any,
    cb: (a: any, b: any, c: any) => void = noop,
    { timeLimit = 10000 } = {},
    Severity: Minor
    Found in packages/brookjs-desalinate/src/jestPlugin.tsx - About 35 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      building={
      state.webpack.status === 'idle' ||
      (state.webpack.status === 'running' && state.webpack.building)
      }
      Severity: Minor
      Found in packages/brookjs-cli/src/commands/BuildCommand/index.tsx and 1 other location - About 35 mins to fix
      packages/brookjs-cli/src/commands/StartCommand/index.tsx on lines 146..149

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      building={
      state.webpack.status === 'idle' ||
      (state.webpack.status === 'running' && state.webpack.building)
      }
      Severity: Minor
      Found in packages/brookjs-cli/src/commands/StartCommand/index.tsx and 1 other location - About 35 mins to fix
      packages/brookjs-cli/src/commands/BuildCommand/index.tsx on lines 58..61

      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

      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

      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

      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

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      const Unit: React.FC<{ args: Arguments<Args>; rc: unknown; cwd: string }> = ({
      args,
      rc,
      cwd,
      }) => {
      Severity: Minor
      Found in packages/brookjs-cli/src/commands/TestCommand/Unit/index.tsx and 2 other locations - About 35 mins to fix
      packages/brookjs-cli/src/commands/TestCommand/Check/index.tsx on lines 13..40
      packages/brookjs-cli/src/commands/TestCommand/Lint/index.tsx on lines 13..67

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      const Check: React.FC<{ args: Arguments<Args>; rc: unknown; cwd: string }> = ({
      rc,
      cwd,
      }) => {
      const { state, dispatch } = useDelta(reducer, initialState(cwd, rc), exec);
      Severity: Minor
      Found in packages/brookjs-cli/src/commands/TestCommand/Check/index.tsx and 2 other locations - About 35 mins to fix
      packages/brookjs-cli/src/commands/TestCommand/Lint/index.tsx on lines 13..67
      packages/brookjs-cli/src/commands/TestCommand/Unit/index.tsx on lines 10..26

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      const Lint: React.FC<{ args: Arguments<Args>; rc: unknown; cwd: string }> = ({
      rc,
      cwd,
      }) => {
      const { state, dispatch } = useDelta(reducer, initialState(cwd, rc), exec);
      Severity: Minor
      Found in packages/brookjs-cli/src/commands/TestCommand/Lint/index.tsx and 2 other locations - About 35 mins to fix
      packages/brookjs-cli/src/commands/TestCommand/Check/index.tsx on lines 13..40
      packages/brookjs-cli/src/commands/TestCommand/Unit/index.tsx on lines 10..26

      Avoid too many return statements within this function.
      Open

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