teamdigitale/italia-app

View on GitHub
ts/features/messages/store/reducers/allPaginated.ts

Summary

Maintainability
F
1 wk
Test Coverage

File allPaginated.ts has 740 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as pot from "@pagopa/ts-commons/lib/pot";
import { constFalse, constUndefined, pipe } from "fp-ts/lib/function";
import * as B from "fp-ts/lib/boolean";
import * as RA from "fp-ts/lib/ReadonlyArray";
import * as O from "fp-ts/lib/Option";
Severity: Major
Found in ts/features/messages/store/reducers/allPaginated.ts - About 1 day to fix

    Function reduceUpsertMessageStatusAttributes has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

    const reduceUpsertMessageStatusAttributes = (
      state: AllPaginated = INITIAL_STATE,
      action: Action
      // eslint-disable-next-line sonarjs/cognitive-complexity
    ): AllPaginated => {
    Severity: Minor
    Found in ts/features/messages/store/reducers/allPaginated.ts - About 6 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 reduceUpsertMessageStatusAttributes has 129 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const reduceUpsertMessageStatusAttributes = (
      state: AllPaginated = INITIAL_STATE,
      action: Action
      // eslint-disable-next-line sonarjs/cognitive-complexity
    ): AllPaginated => {
    Severity: Major
    Found in ts/features/messages/store/reducers/allPaginated.ts - About 5 hrs to fix

      Function reduceLoadPreviousPage has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const reduceLoadPreviousPage = (
        state: AllPaginated = INITIAL_STATE,
        action: Action
      ): AllPaginated => {
        switch (action.type) {
      Severity: Major
      Found in ts/features/messages/store/reducers/allPaginated.ts - About 3 hrs to fix

        Function reduceLoadNextPage has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const reduceLoadNextPage = (
          state: AllPaginated = INITIAL_STATE,
          action: Action
        ): AllPaginated => {
          switch (action.type) {
        Severity: Major
        Found in ts/features/messages/store/reducers/allPaginated.ts - About 3 hrs to fix

          Function reduceReloadAll has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const reduceReloadAll = (
            state: AllPaginated = INITIAL_STATE,
            action: Action
          ): AllPaginated => {
            switch (action.type) {
          Severity: Major
          Found in ts/features/messages/store/reducers/allPaginated.ts - About 3 hrs to fix

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

            const reducer = (
              state: AllPaginated = INITIAL_STATE,
              action: Action
            ): AllPaginated => {
              switch (action.type) {
            Severity: Minor
            Found in ts/features/messages/store/reducers/allPaginated.ts - About 1 hr to fix

              Function reduceLoadPreviousPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              const reduceLoadPreviousPage = (
                state: AllPaginated = INITIAL_STATE,
                action: Action
              ): AllPaginated => {
                switch (action.type) {
              Severity: Minor
              Found in ts/features/messages/store/reducers/allPaginated.ts - About 45 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 reduceLoadNextPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              const reduceLoadNextPage = (
                state: AllPaginated = INITIAL_STATE,
                action: Action
              ): AllPaginated => {
                switch (action.type) {
              Severity: Minor
              Found in ts/features/messages/store/reducers/allPaginated.ts - 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

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

              const reduceReloadAll = (
                state: AllPaginated = INITIAL_STATE,
                action: Action
              ): AllPaginated => {
                switch (action.type) {
              Severity: Minor
              Found in ts/features/messages/store/reducers/allPaginated.ts - 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 { ...state };
              Severity: Major
              Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return state;
                Severity: Major
                Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return {
                          ...state,
                          inbox: {
                            ...state.inbox,
                            data: pot.toError(state.inbox.data, {
                  Severity: Major
                  Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return {
                              ...state,
                              archive: {
                                ...state.archive,
                                data: pot.toError(state.archive.data, {
                    Severity: Major
                    Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return {
                              ...state,
                              inbox: {
                                ...state.inbox,
                                data: pot.toError(state.inbox.data, {
                      Severity: Major
                      Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return {
                                      ...state,
                                      archive: remove(message, state.archive),
                                      inbox: insert(message, state.inbox),
                                      latestMessageOperation: E.left({
                        Severity: Major
                        Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return {
                                        ...state,
                                        archive: insert(message, state.archive),
                                        inbox: remove(message, state.inbox),
                                        latestMessageOperation: E.left({
                          Severity: Major
                          Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return {
                                      ...state,
                                      archive: {
                                        ...state.archive,
                                        data: pot.toError(state.archive.data, {
                            Severity: Major
                            Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                        return {
                                          ...state,
                                          archive: replace(message, state.archive),
                                          inbox: replace(message, state.inbox)
                                        };
                              Severity: Major
                              Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return {
                                          ...state,
                                          archive: {
                                            ...state.archive,
                                            data: pot.toError(state.inbox.data, {
                                Severity: Major
                                Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return {
                                          ...state,
                                          inbox: {
                                            ...state.inbox,
                                            data: pot.toError(state.inbox.data, {
                                  Severity: Major
                                  Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return {
                                              ...state,
                                              latestMessageOperation: E.right(
                                                update.isArchived ? "archive" : "restore"
                                              )
                                    Severity: Major
                                    Found in ts/features/messages/store/reducers/allPaginated.ts - About 30 mins to fix

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

                                          case getType(loadNextPageMessages.failure):
                                            if (action.payload.filter.getArchived) {
                                              return {
                                                ...state,
                                                archive: {
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 2 other locations - About 7 hrs to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 178..202
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 372..396

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 193.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                          case getType(reloadAllMessages.failure):
                                            if (action.payload.filter.getArchived) {
                                              return {
                                                ...state,
                                                archive: {
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 2 other locations - About 7 hrs to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 274..298
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 372..396

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 193.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                          case getType(loadPreviousPageMessages.failure):
                                            if (action.payload.filter.getArchived) {
                                              return {
                                                ...state,
                                                archive: {
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 2 other locations - About 7 hrs to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 178..202
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 274..298

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 193.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                          case getType(loadNextPageMessages.request):
                                            if (action.payload.filter.getArchived) {
                                              return {
                                                ...state,
                                                archive: {
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 5 hrs to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 310..328

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 139.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                          case getType(loadPreviousPageMessages.request):
                                            if (action.payload.filter.getArchived) {
                                              return {
                                                ...state,
                                                archive: {
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 5 hrs to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 214..232

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 139.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                              return {
                                                ...state,
                                                archive: {
                                                  data: pot.some({
                                                    page: action.payload.messages,
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 2 hrs to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 164..175

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 91.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                            return {
                                              ...state,
                                              inbox: {
                                                data: pot.some({
                                                  page: action.payload.messages,
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 2 hrs to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 151..162

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 91.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                      const INITIAL_STATE: AllPaginated = {
                                        archive: { data: pot.none, lastRequest: O.none, lastUpdateTime: new Date(0) },
                                        inbox: { data: pot.none, lastRequest: O.none, lastUpdateTime: new Date(0) },
                                        shownCategory: "INBOX"
                                      };
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 2 hrs to fix
                                      ts/features/messages/store/reducers/__tests__/allPaginated.test.ts on lines 887..891

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 84.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                                if (update.isArchived) {
                                                  return {
                                                    ...state,
                                                    archive: remove(message, state.archive),
                                                    inbox: insert(message, state.inbox),
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 1 hr to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 563..573

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 70.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                                } else {
                                                  return {
                                                    ...state,
                                                    archive: insert(message, state.archive),
                                                    inbox: remove(message, state.inbox),
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 1 hr to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 553..563

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 70.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                      export const shouldShowRefreshControllOnListSelector = (
                                        state: GlobalState,
                                        category: MessageListCategory
                                      ) =>
                                        pipe(
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 1 hr to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 668..678

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 59.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                      export const shouldShowFooterListComponentSelector = (
                                        state: GlobalState,
                                        category: MessageListCategory
                                      ) =>
                                        pipe(
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 1 hr to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 680..690

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 59.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                                O.getOrElse(() =>
                                                  pot.some({
                                                    page: [...action.payload.messages],
                                                    previous: action.payload.pagination.previous
                                                  })
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 1 hr to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 246..251

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 55.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                                O.getOrElse(() =>
                                                  pot.some({
                                                    page: [...action.payload.messages],
                                                    next: action.payload.pagination.next
                                                  })
                                      Severity: Major
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 1 hr to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 344..349

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 55.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                      export const archiveMessagesErrorReasonSelector = (state: GlobalState) =>
                                        pipe(
                                          state.entities.messages.allPaginated.archive.data,
                                          messagePotToToastReportableErrorOrUndefined
                                        );
                                      Severity: Minor
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 30 mins to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 745..749

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

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

                                      export const inboxMessagesErrorReasonSelector = (state: GlobalState) =>
                                        pipe(
                                          state.entities.messages.allPaginated.inbox.data,
                                          messagePotToToastReportableErrorOrUndefined
                                        );
                                      Severity: Minor
                                      Found in ts/features/messages/store/reducers/allPaginated.ts and 1 other location - About 30 mins to fix
                                      ts/features/messages/store/reducers/allPaginated.ts on lines 751..755

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      There are no issues that match your filters.

                                      Category
                                      Status