bokuweb/tuna_pasta

View on GitHub

Showing 24 of 37 total issues

Function feed has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

export default function feed(state={}, action) {
  let elementHeight;
  switch(action.type){
    case types.INITIALIZING :
      state.isInitialized = false;
Severity: Minor
Found in src/reducers/feed.js - About 4 hrs 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 feed has 111 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function feed(state={}, action) {
  let elementHeight;
  switch(action.type){
    case types.INITIALIZING :
      state.isInitialized = false;
Severity: Major
Found in src/reducers/feed.js - About 4 hrs to fix

    Function menu has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function menu(state={}, action) {
      switch(action.type){
        case types.INITIALIZE_KEYWORD :
          state.keywords = action.keywords;
          state.activeKeyword = 'all';
    Severity: Minor
    Found in src/reducers/menu.js - About 1 hr to fix

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

        render() {
          if (!this.props.feed.isInitialized) return <div className="rect-spinner"></div>;
          const feed = this.props.feed[this.props.menu.activeKeyword];
          return (
            <div id="container">
      Severity: Minor
      Found in src/components/pasta.js - About 1 hr to fix

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

        module.exports = function(config) {
          config.set({
        
            // base path that will be used to resolve all patterns (eg. files, exclude)
            basePath: '',
        Severity: Minor
        Found in karma.conf.js - About 1 hr to fix

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

            render() {
              const {item, activeKeyword, id, bookmarkFilter} = this.props;
              const favicon = FAVICON_URI + encodeURIComponent(item.link);
              const hatebuHref = ENTRY_URI + encodeURIComponent(item.link);
              const hatebuImage = BOOKMARK_IMAGE_URI + item.link;
          Severity: Minor
          Found in src/components/item.js - About 1 hr to fix

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

            function _fetchUserFeed(dispatch, keyword, user, page = 0, threshold) {
            Severity: Minor
            Found in src/actions/feed.js - About 35 mins to fix

              Avoid too many return statements within this function.
              Open

                    return Object.assign({}, state);
              Severity: Major
              Found in src/reducers/feed.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return Object.assign({}, state);
                Severity: Major
                Found in src/reducers/feed.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return Object.assign({}, state);
                  Severity: Major
                  Found in src/reducers/menu.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return Object.assign({}, state);
                    Severity: Major
                    Found in src/reducers/feed.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return Object.assign({}, state);
                      Severity: Major
                      Found in src/reducers/feed.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return Object.assign({}, state);
                        Severity: Major
                        Found in src/reducers/feed.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return Object.assign({}, state);
                          Severity: Major
                          Found in src/reducers/feed.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return Object.assign({}, state);
                            Severity: Major
                            Found in src/reducers/feed.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return Object.assign({}, state);
                              Severity: Major
                              Found in src/reducers/feed.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return Object.assign({}, state);
                                Severity: Major
                                Found in src/reducers/feed.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return Object.assign({}, state);
                                  Severity: Major
                                  Found in src/reducers/feed.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          return Object.assign({}, state);
                                    Severity: Major
                                    Found in src/reducers/menu.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return Object.assign({}, state);
                                      Severity: Major
                                      Found in src/reducers/feed.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language