kabisa/kudos-frontend

View on GitHub

Showing 226 of 230 total issues

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

const InviteList = () => (
  <div>
    <Query<InvitesResult>
      query={GET_INVITES}
      pollInterval={2000}
Severity: Minor
Found in src/modules/choose-team/components/InviteList.tsx - 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

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

          <div className={styles.column}>
            <CreatePost back={false} />
            <KudoBoard />
          </div>
Severity: Minor
Found in src/modules/feed/FeedPage.tsx and 1 other location - About 35 mins to fix
src/modules/feed/FeedPage.tsx on lines 33..36

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 46.

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

        <div className={styles.tabletAndBelowContainer}>
          <CreatePost back={false} />
          <KudoBoard />
        </div>
Severity: Minor
Found in src/modules/feed/FeedPage.tsx and 1 other location - About 35 mins to fix
src/modules/feed/FeedPage.tsx on lines 40..43

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 46.

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

Avoid too many return statements within this function.
Open

      return;
Severity: Major
Found in src/modules/feed/components/CreatePost/CreatePost.tsx - About 30 mins to fix

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

        client.writeQuery({
          query: GET_USERS,
          variables: {
            team_id: Storage.getItem(settings.TEAM_ID_TOKEN),
          },
    Severity: Minor
    Found in src/modules/feed/components/UserDropdown/UserDropdown.tsx and 1 other location - About 30 mins to fix
    src/modules/feed/components/CreatePost/CreatePost.tsx on lines 295..301

    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

    Avoid too many return statements within this function.
    Open

        return true;
    Severity: Major
    Found in src/modules/user/ResetPasswordPage.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return false;
      Severity: Major
      Found in src/modules/user/ResetPasswordPage.tsx - About 30 mins to fix

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

                      cache.writeQuery({
                        query: GET_GOAL_PERCENTAGE,
                        variables: {
                          team_id: Storage.getItem(settings.TEAM_ID_TOKEN),
                        },
        Severity: Minor
        Found in src/modules/feed/components/CreatePost/CreatePost.tsx and 1 other location - About 30 mins to fix
        src/modules/feed/components/UserDropdown/UserDropdown.tsx on lines 100..106

        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

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

          onSubmit(
            e: FormEvent<HTMLFormElement>,
            createPost: any,
            client: ApolloClient<any>,
          ) {
        Severity: Minor
        Found in src/modules/feed/components/CreatePost/CreatePost.tsx - 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 Invite has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        export function Invite(props: InviteProps) {
          const showConfirmDialog = (
            deleteInvite: MutationFunction<
              DeleteInviteParameters,
              OperationVariables,
        Severity: Minor
        Found in src/modules/manage-team/sections/invite/Invite.tsx - 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

        Missing return type on function.
        Open

        const Navigation = ({ children }: NavigationProps) => {
        Severity: Minor
        Found in src/ui/Navigation/index.tsx by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        Missing return type on function.
        Open

          componentDidMount() {

        For more information visit Source: http://eslint.org/docs/rules/

        Missing return type on function.
        Open

        const Dropdown = ({ label, children }: DropdownProps) => {
        Severity: Minor
        Found in src/ui/Dropdown/index.tsx by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        Argument 'mutate' should be typed with a non-any type.
        Open

          openConfirmDialog(mutate: any) {

        For more information visit Source: http://eslint.org/docs/rules/

        Missing return type on function.
        Open

          onCompleted() {

        For more information visit Source: http://eslint.org/docs/rules/

        Missing return type on function.
        Open

        const Statistics = () => (

        For more information visit Source: http://eslint.org/docs/rules/

        Missing return type on function.
        Open

          sendInvites(mutate: any) {

        For more information visit Source: http://eslint.org/docs/rules/

        Component definition is missing display name
        Open

          Decorator: ({ Component, settings }) => (

        For more information visit Source: http://eslint.org/docs/rules/

        An empty interface is equivalent to {}.
        Open

        export interface Props {

        For more information visit Source: http://eslint.org/docs/rules/

        Missing return type on function.
        Open

        export function Invite(props: InviteProps) {

        For more information visit Source: http://eslint.org/docs/rules/

        Severity
        Category
        Status
        Source
        Language