mAAdhaTTah/brookjs

View on GitHub

Showing 71 of 74 total issues

Function load has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

static load(target: string) {
const filename = App.resolve(target);
 
const oldNodeEnv = process.env.NODE_ENV;
process.env.NODE_ENV = 'production';
Severity: Minor
Found in packages/brookjs-cli/src/cli/App.tsx - About 1 hr to fix

    Function reducer has 40 lines of code (exceeds 25 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 1 hr to fix

      Function observeDelta has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function observeDelta<A extends { type: string }, S>(
      ...sources: Delta<A, S>[]
      ): Middleware<Ext, S> {
      return store => {
      const action$: Stream<A, never> = new (Kefir as any).Stream().setName(
      Severity: Minor
      Found in packages/brookjs-eddy/src/observeDelta.ts - About 1 hr to fix

        Function exec has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const exec: Delta<Action, State> = (action$, state$) => {
        const glob$ = glob.delta(
        action$.thru(ofType(glob.actions.format.request)),
        state$.map(state => ({
        cwd: state.cwd,
        Severity: Minor
        Found in packages/brookjs-cli/src/commands/FormatCommand/index.tsx - About 1 hr to fix

          Function addHotReload has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          const addHotReload = (
          entry: webpack.Configuration['entry'],
          ): webpack.Configuration['entry'] => {
          const client = require.resolve('react-dev-utils/webpackHotDevClient');
           
           
          Severity: Minor
          Found in packages/brookjs-cli/src/webpack/selectors.ts - About 1 hr to fix

          Function useDelta has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const useDelta = <S, A extends Action<string>>(
          reducer: Reducer<S, A> | EddyReducer<S, A>,
          initialState: S,
          delta: Delta<A, S> = defaultDelta,
          ) => {
          Severity: Minor
          Found in packages/brookjs-silt/src/useDelta.ts - About 1 hr to fix

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

            return new App(this.name, this.commands, [
            ...this.errors,
            <LoadDirError key={this.errors.length} error={error} dir={target} />,
            ]);
            Severity: Major
            Found in packages/brookjs-cli/src/cli/App.tsx and 1 other location - About 1 hr to fix
            packages/brookjs-cli/src/cli/App.tsx on lines 97..104

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

            new App(this.name, this.commands, [
            ...this.errors,
            <CommandValidationError
            key={this.errors.length}
            name={name}
            Severity: Major
            Found in packages/brookjs-cli/src/cli/App.tsx and 1 other location - About 1 hr to fix
            packages/brookjs-cli/src/cli/App.tsx on lines 117..120

            Function spawn has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            spawn(bin: string, command: string) {
            this.process = {
            stdout: '',
            closed: false,
            code: null
            Severity: Minor
            Found in packages/brookjs-cli/features/support/world.ts - About 1 hr to fix

              Function toEmitFromJunction has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              toEmitFromJunction(
              this: any,
              element: any,
              expected: any,
              cb: (a: any, b: any, c: any) => void = noop,
              Severity: Minor
              Found in packages/brookjs-desalinate/src/jestPlugin.tsx - About 1 hr to fix

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

                const webpack$ = webpack.delta(
                action$.thru(ofType(webpack.actions.build.request)),
                state$.map(({ webpack }) => webpack),
                );
                Severity: Major
                Found in packages/brookjs-cli/src/commands/BuildCommand/exec.ts and 1 other location - About 1 hr to fix
                packages/brookjs-cli/src/commands/BuildCommand/exec.ts on lines 9..12

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

                const project$ = project.delta(
                action$.thru(ofType(project.actions.initialize.request)),
                state$.map(({ project }) => project),
                );
                Severity: Major
                Found in packages/brookjs-cli/src/commands/BuildCommand/exec.ts and 1 other location - About 1 hr to fix
                packages/brookjs-cli/src/commands/BuildCommand/exec.ts on lines 14..17

                Function format has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const format = (
                path: string,
                buffer?: Buffer,
                ): Observable<FormatResult, FormatError> => {
                const buffer$: Observable<Buffer, NodeJS.ErrnoException> = buffer
                Severity: Minor
                Found in packages/brookjs-cli/src/prettier/index.ts - About 1 hr to fix

                  Function withRef$ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ) => (
                  WrappedComponent: React.ForwardRefRenderFunction<E, P> | React.ElementType<P>,
                  ) => {
                  // @TODO(mAAdhaTTah) why isn't this type working?
                  const Target = wrap(WrappedComponent) as any;
                  Severity: Minor
                  Found in packages/brookjs-silt/src/withRef.tsx - About 1 hr to fix

                    Identical blocks of code found in 4 locations. Consider refactoring.
                    Open

                    export function toJunction<E extends { [key: string]: any }>(
                    events: Events<E>,
                    combine: Combiner,
                    ): <P extends {}>(
                    WrappedComponent: React.ComponentType<P>,
                    Severity: Major
                    Found in packages/brookjs-silt/src/toJunction.tsx and 3 other locations - About 55 mins to fix
                    packages/brookjs-silt/src/toJunction.tsx on lines 37..39
                    packages/brookjs-silt/src/toJunction.tsx on lines 40..44
                    packages/brookjs-silt/src/toJunction.tsx on lines 51..55

                    Identical blocks of code found in 4 locations. Consider refactoring.
                    Open

                    export function toJunction<E extends { [key: string]: any }>(
                    events: Events<E>,
                    ): <P extends {}>(
                    WrappedComponent: React.ComponentType<P>,
                    ) => React.FC<WithProps<E, P>>;
                    Severity: Major
                    Found in packages/brookjs-silt/src/toJunction.tsx and 3 other locations - About 55 mins to fix
                    packages/brookjs-silt/src/toJunction.tsx on lines 37..39
                    packages/brookjs-silt/src/toJunction.tsx on lines 45..50
                    packages/brookjs-silt/src/toJunction.tsx on lines 51..55

                    Identical blocks of code found in 4 locations. Consider refactoring.
                    Open

                    export function toJunction<E extends { [key: string]: any }>(
                    combine: Combiner,
                    ): <P extends {}>(
                    WrappedComponent: React.ComponentType<P>,
                    ) => React.FC<WithProps<E, P>>;
                    Severity: Major
                    Found in packages/brookjs-silt/src/toJunction.tsx and 3 other locations - About 55 mins to fix
                    packages/brookjs-silt/src/toJunction.tsx on lines 37..39
                    packages/brookjs-silt/src/toJunction.tsx on lines 40..44
                    packages/brookjs-silt/src/toJunction.tsx on lines 45..50

                    Identical blocks of code found in 4 locations. Consider refactoring.
                    Open

                    export function toJunction<E extends { [key: string]: any }>(): <P extends {}>(
                    WrappedComponent: React.ComponentType<P>,
                    ) => React.FC<WithProps<E, P>>;
                    Severity: Major
                    Found in packages/brookjs-silt/src/toJunction.tsx and 3 other locations - About 55 mins to fix
                    packages/brookjs-silt/src/toJunction.tsx on lines 40..44
                    packages/brookjs-silt/src/toJunction.tsx on lines 45..50
                    packages/brookjs-silt/src/toJunction.tsx on lines 51..55

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

                    const webpack$ = webpackDelta(
                    action$.thru(ofType(actions.start.request)),
                    state$.map(({ webpack }) => webpack),
                    );
                    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 60..63

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

                    Given('I create {string} with contents', async function(
                    path: string,
                    contents: string
                    ) {
                    await this.outputFile({ 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 72..77
                    Severity
                    Category
                    Status
                    Source
                    Language