mAAdhaTTah/brookjs

View on GitHub

Showing 71 of 74 total issues

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

export const reducer: EddyReducer<State, Action> = (
state = initialState('/', null),
action,
) => {
switch (action.type) {
Severity: Major
Found in packages/brookjs-cli/src/commands/TestCommand/Lint/reducer.tsx and 1 other location - About 2 days to fix
packages/brookjs-cli/src/commands/TestCommand/Check/reducer.tsx on lines 8..52

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

export const reducer: EddyReducer<State, Action> = (
state = initialState('/', null),
action,
) => {
switch (action.type) {
packages/brookjs-cli/src/commands/TestCommand/Lint/reducer.tsx on lines 8..52

File selectors.ts has 510 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// @todo: readd NpmInstallPlugin
// @todo: clean up this file (extra functions, commented out code, etc.)
import path from 'path';
// import address from 'address';
import webpack, { Loader } from 'webpack';
Severity: Major
Found in packages/brookjs-cli/src/webpack/selectors.ts - About 1 day to fix

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

    const format$ = state$
    .thru(sampleByAction(action$, actions.format.request))
    .flatMap(state =>
    service(selectFormatGlob(state.cwd, state.rc?.dir ?? 'src'))
    .map(files => actions.format.success(files))
    Severity: Major
    Found in packages/brookjs-cli/src/glob/index.ts and 1 other location - About 4 hrs to fix
    packages/brookjs-cli/src/glob/index.ts on lines 35..41

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

    const lint$ = state$
    .thru(sampleByAction(action$, actions.lint.request))
    .flatMap(state =>
    service(selectLintGlob(state.cwd, state.rc?.dir ?? 'src'))
    .map(files => actions.lint.success(files))
    Severity: Major
    Found in packages/brookjs-cli/src/glob/index.ts and 1 other location - About 4 hrs to fix
    packages/brookjs-cli/src/glob/index.ts on lines 43..49

    Function reducer has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const reducer = (state: State, action: Action): State => {
    switch (action.type) {
    case 'INPUT':
    // Only handle input on configure step.
    if (state.step !== 'configure') {
    Severity: Major
    Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts - About 3 hrs to fix

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

      <Box flexDirection="column" marginBottom={1}>
      <Box marginBottom={1}>
      <Color yellowBright>Compilation warnings:</Color>
      </Box>
      {warnings.map((warning, i) => (
      Severity: Major
      Found in packages/brookjs-cli/src/commands/components/webpack.tsx and 1 other location - About 3 hrs to fix
      packages/brookjs-cli/src/commands/components/webpack.tsx on lines 58..65

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

      <Box flexDirection="column" marginBottom={1}>
      <Box marginBottom={1}>
      <Color redBright>Compilation errors:</Color>
      </Box>
      {errors.map((error, i) => (
      Severity: Major
      Found in packages/brookjs-cli/src/commands/components/webpack.tsx and 1 other location - About 3 hrs to fix
      packages/brookjs-cli/src/commands/components/webpack.tsx on lines 31..38

      Function selectWebpackConfig has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const selectWebpackConfig = (
      state: BuildConfig,
      ): webpack.Configuration => {
      let entry = selectWebpackEntry(state);
       
       
      Severity: Major
      Found in packages/brookjs-cli/src/webpack/selectors.ts - About 2 hrs to fix

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

        return {
        pass: this.equals(log, expected),
        message: () =>
        this.utils.matcherHint(
        `${this.isNot ? '.not' : ''}.toEmitFromDelta`,
        Severity: Major
        Found in packages/brookjs-desalinate/src/jestPlugin.tsx and 1 other location - About 2 hrs to fix
        packages/brookjs-desalinate/src/jestPlugin.tsx on lines 92..100

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

        return {
        pass: this.equals(log, expected),
        message: () =>
        this.utils.matcherHint(
        `${this.isNot ? '.not' : ''}.toEmitFromJunction`,
        Severity: Major
        Found in packages/brookjs-desalinate/src/jestPlugin.tsx and 1 other location - About 2 hrs to fix
        packages/brookjs-desalinate/src/jestPlugin.tsx on lines 49..57

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

        const reducer = (state: State, action: Action): State => {
        switch (action.type) {
        case 'INPUT':
        // Only handle input on configure step.
        if (state.step !== 'configure') {
        Severity: Minor
        Found in packages/brookjs-cli/src/commands/NewCommand/reducer.ts - About 2 hrs to fix

        Function toJunction has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function toJunction<E extends { [key: string]: any }>(
        _events: Events<E> | Combiner = {} as Events<E>,
        _combine: Combiner = id,
        ) {
        let events: Events<E>, combine: Combiner;
        Severity: Minor
        Found in packages/brookjs-silt/src/toJunction.tsx - About 1 hr to fix

          Function selectStyleLoaders has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const selectStyleLoaders = (
          state: BuildConfig,
          cssLoaderOptions: object,
          preProcessor?: string,
          ) => {
          Severity: Minor
          Found in packages/brookjs-cli/src/webpack/selectors.ts - About 1 hr to fix

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

            return (
            <Box flexDirection="column">
            <Color green>Success! All files are correctly linted.</Color>
            <Color greenBright>
            Checked {total} file{total === 1 ? '' : 's'}
            packages/brookjs-cli/src/commands/FormatCommand/index.tsx on lines 178..185

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

            return (
            <Box flexDirection="column">
            <Color green>Success! All files have been formatted.</Color>
            <Color greenBright>
            Formatted {total} file{total === 1 ? '' : 's'}
            Severity: Major
            Found in packages/brookjs-cli/src/commands/FormatCommand/index.tsx and 1 other location - About 1 hr to fix
            packages/brookjs-cli/src/commands/TestCommand/Lint/Completed.tsx on lines 73..80

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

            componentDidMount() {
            this.mounted = true;
            const { api } = this.props;
             
            api.on(EVENT_ID, this.addAction);
            Severity: Major
            Found in packages/brookjs-desalinate/src/storybook.tsx and 1 other location - About 1 hr to fix
            packages/brookjs-desalinate/src/storybook.tsx on lines 135..141

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

            componentWillUnmount() {
            this.mounted = false;
            const { api } = this.props;
             
            api.off(STORY_RENDERED, this.handleStoryChange);
            Severity: Major
            Found in packages/brookjs-desalinate/src/storybook.tsx and 1 other location - About 1 hr to fix
            packages/brookjs-desalinate/src/storybook.tsx on lines 127..133

            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/Lint/reducer.tsx - About 1 hr to fix

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

              const selectEnvPlugins = (state: BuildConfig) => {
              const plugins = state.watch
              ? [
              // If you require a missing module and then `npm install` it, you still have
              // to restart the development server for Webpack to discover it. This plugin
              Severity: Minor
              Found in packages/brookjs-cli/src/webpack/selectors.ts - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language