nelsonic/este

View on GitHub

Showing 35 of 94 total issues

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

export default function start(Wrapped) {
  class Start extends Component {

    static propTypes = {
      intl: PropTypes.object.isRequired,
Severity: Minor
Found in src/common/app/start.js - About 1 hr to fix

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

    export default function updateList(
      list,
      ItemRecord,
      idProp,
      args
    Severity: Minor
    Found in src/common/lib/redux-firebase/updateList.js - About 1 hr to fix

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

      export default function render(req, res, next) {
        const memoryHistory = createMemoryHistory(req.originalUrl);
        const store = configureStore({
          initialState: createRequestInitialState(req),
          platformMiddleware: [routerMiddleware(memoryHistory)]
      Severity: Minor
      Found in src/server/frontend/render.js - About 1 hr to fix

        Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const { fields, online } = this.props;
        
            return (
              <div className="offline-page">
        Severity: Minor
        Found in src/browser/offline/OfflinePage.react.js - About 1 hr to fix

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

          export default function todosReducer(state = new InitialState, action) {
            switch (action.type) {
          
              case actions.ADD_HUNDRED_TODOS: {
                const todos = action.payload.reduce((todos, json) =>
          Severity: Minor
          Found in src/common/todos/reducer.js - About 1 hr to fix

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

            export default function errorHandler(err, req, res, next) { // eslint-disable-line no-unused-vars
              const errorDetails = err.stack || err;
            
              console.error('Yay', errorDetails);
            
            
            Severity: Minor
            Found in src/server/lib/errorHandler.js - 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 list.delete(index).insert(getInsertIndex(), list.get(index));
            Severity: Major
            Found in src/common/lib/redux-firebase/updateList.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return List(val).map(item => new ItemRecord(item));
              Severity: Major
              Found in src/common/lib/redux-firebase/updateList.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      if (index === -1) return list;
                Severity: Major
                Found in src/common/lib/redux-firebase/updateList.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return state;
                  Severity: Major
                  Found in src/common/todos/reducer.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          if (index === -1) return list;
                    Severity: Major
                    Found in src/common/lib/redux-firebase/updateList.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return state.updateIn(['map', todo.id, 'completed'], value => !value);
                      Severity: Major
                      Found in src/common/todos/reducer.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return state.update('map', map => map.delete(id));
                        Severity: Major
                        Found in src/common/todos/reducer.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return list.delete(index);
                          Severity: Major
                          Found in src/common/lib/redux-firebase/updateList.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return list;
                            Severity: Major
                            Found in src/common/lib/redux-firebase/updateList.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language