Takumon/mean-blog

View on GitHub

Showing 100 of 340 total issues

Avoid too many return statements within this function.
Open

      return Object.assign({}, {
        ...state,
        article: null,
        loadingArticle: false,
      });
Severity: Major
Found in src/app/state/article.reducer.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return Object.assign({}, {...state, loading: true} );
    Severity: Major
    Found in src/app/state/article.reducer.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return state;
      Severity: Major
      Found in src/app/state/article.reducer.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return {
                dateFrom: thisMonthStart.toDate(),
                dateTo  : todayEnd.toDate()
              };
        Severity: Major
        Found in src/app/shared/enum/date-range-pattern.enum.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return Object.assign({}, {...state, loading: true} );
          Severity: Major
          Found in src/app/drafts/state/draft.reducer.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return adapter.removeAll(state);
            Severity: Major
            Found in src/app/state/article.reducer.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return Object.assign({}, {...state, loadingArticle: true, article: null} );
              Severity: Major
              Found in src/app/state/article.reducer.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return Object.assign({}, {...state, loadingVote: true});
                Severity: Major
                Found in src/app/state/article.reducer.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return d.getUTCSeconds() + '秒前';
                  Severity: Major
                  Found in src/app/shared/pipes/fromnow.pipe.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return adapter.upsertMany(action.payload.drafts, state);
                    Severity: Major
                    Found in src/app/drafts/state/draft.reducer.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return adapter.removeAll(state);
                      Severity: Major
                      Found in src/app/drafts/state/draft.reducer.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return adapter.addAll(action.payload.articles, {
                                ...state,
                                count: action.payload.count,
                                loading: false
                              } );
                        Severity: Major
                        Found in src/app/state/article.reducer.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return adapter.updateOne(action.payload.article, {
                                  ...state,
                                  loading: false
                                });
                          Severity: Major
                          Found in src/app/state/article.reducer.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return Object.assign({}, {
                                    ...state,
                                    loading: false,
                                  });
                            Severity: Major
                            Found in src/app/state/article.reducer.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return Object.assign({}, {...state, loadingArticle: false} );
                              Severity: Major
                              Found in src/app/state/article.reducer.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return Object.assign({}, {...state, loadingArticle: false});
                                Severity: Major
                                Found in src/app/state/article.reducer.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return Object.assign({}, {
                                          ...state,
                                          article: {
                                            ...state.article,
                                            vote: action.payload.vote
                                  Severity: Major
                                  Found in src/app/state/article.reducer.ts - About 30 mins to fix

                                    Function transform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      transform(datetime: string, args?) {
                                    
                                        if (!datetime) {
                                          return datetime;
                                        }
                                    Severity: Minor
                                    Found in src/app/shared/pipes/fromnow.pipe.ts - About 25 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

                                    Function adjustIndent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      private adjustIndent($event) {
                                        const TAB = '    ';
                                        // インデントを追加
                                        if (!$event.shiftKey) {
                                          if (this.extractListInfo().isListLine) {
                                    Severity: Minor
                                    Found in src/app/drafts/draft-edit/draft-edit-area.component.ts - About 25 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

                                    Function dateRangeDisp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      dateRangeDisp(condition: SearchConditionModel): string {
                                        const pattern = condition.dateSearchPattern;
                                    
                                        const patternDisp = this.dateRangePatterns[pattern];
                                    
                                    
                                    Severity: Minor
                                    Found in src/app/articles/search-condition/search-condition.component.ts - About 25 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language