LukeSheard/Monzo-Dashboard

View on GitHub

Showing 63 of 63 total issues

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

  return new Promise((resolve, reject) => request
    .post(`${baseUrl}/oauth2/token`)
    .type('form')
    .send({
      grant_type: 'refresh_token',
Severity: Major
Found in src/server/token/refresh.js and 1 other location - About 3 hrs to fix
src/server/token/issue.js on lines 20..51

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

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

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

    return new Promise((resolve, reject) => request
      .post(`${baseUrl}/oauth2/token`)
      .type('form')
      .send({
        grant_type: 'authorization_code',
Severity: Major
Found in src/server/token/issue.js and 1 other location - About 3 hrs to fix
src/server/token/refresh.js on lines 22..52

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

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 render has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      activeUrl,
      loggedIn,
    } = this.props;
Severity: Major
Found in src/common/components/header/index.jsx - About 2 hrs to fix

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

      render() {
        const {
          store,
          renderProps,
        } = this.props;
    Severity: Major
    Found in src/server/html/index.jsx - About 2 hrs to fix

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

        render() {
          const {
            children,
          } = this.props;
          const {
      Severity: Major
      Found in src/common/views/app.jsx - About 2 hrs to fix

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

                <h2 className={s.balanceSpend}>
                  <div>
                    <FormattedNumber
                      style="currency"
                      currency={currency}
        Severity: Major
        Found in src/common/components/balance/index.jsx and 1 other location - About 2 hrs to fix
        src/common/components/balance/index.jsx on lines 51..62

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

        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

                <h2 className={s.balanceInfo}>
                  <div>
                    <FormattedNumber
                      style="currency"
                      currency={currency}
        Severity: Major
        Found in src/common/components/balance/index.jsx and 1 other location - About 2 hrs to fix
        src/common/components/balance/index.jsx on lines 63..74

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

        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 render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const {
              disabled,
              error,
              dateFormat,
        Severity: Minor
        Found in src/common/components/form/date.jsx - About 2 hrs to fix

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

            render() {
              const {
                amount,
                currency,
                date,
          Severity: Minor
          Found in src/common/components/transaction-list/transaction/index.jsx - About 1 hr to fix

            Function default has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function (req, res) {
              const {
                code,
                state,
              } = req.query;
            Severity: Minor
            Found in src/server/token/issue.js - About 1 hr to fix

              Function default has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function (req, res) {
                const refreshCookie = get(`signedCookies[${COOKIE_REFRESH_NAME}]`, req);
              
                if (isEmpty(refreshCookie)) {
                  return res.redirect('/login');
              Severity: Minor
              Found in src/server/token/refresh.js - About 1 hr to fix

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

                  render() {
                    const {
                      children,
                      error,
                      label,
                Severity: Minor
                Found in src/common/components/form/select.jsx - About 1 hr to fix

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

                    render() {
                      const {
                        disabled,
                        error,
                        label,
                  Severity: Minor
                  Found in src/common/components/form/field.jsx - About 1 hr to fix

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

                      render() {
                        const {
                          accounts,
                          fields: {
                            activeAccount,
                    Severity: Minor
                    Found in src/common/routes/settings/index.jsx - About 1 hr to fix

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

                        constructor(props) {
                          super(props);
                      
                          this.getControlId = this.getControlId.bind(this);
                          this.getValidationState = this.getValidationState.bind(this);
                      Severity: Major
                      Found in src/common/components/form/select.jsx and 2 other locations - About 1 hr to fix
                      src/common/components/form/date.jsx on lines 46..51
                      src/common/components/form/field.jsx on lines 35..40

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

                      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

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

                        constructor(props) {
                          super(props);
                      
                          this.getControlId = this.getControlId.bind(this);
                          this.getValidationState = this.getValidationState.bind(this);
                      Severity: Major
                      Found in src/common/components/form/date.jsx and 2 other locations - About 1 hr to fix
                      src/common/components/form/field.jsx on lines 35..40
                      src/common/components/form/select.jsx on lines 31..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 62.

                      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

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

                        constructor(props) {
                          super(props);
                      
                          this.getControlId = this.getControlId.bind(this);
                          this.getValidationState = this.getValidationState.bind(this);
                      Severity: Major
                      Found in src/common/components/form/field.jsx and 2 other locations - About 1 hr to fix
                      src/common/components/form/date.jsx on lines 46..51
                      src/common/components/form/select.jsx on lines 31..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 62.

                      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 render has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          const {
                            fields: {
                              startDate,
                              endDate,
                      Severity: Minor
                      Found in src/common/components/transaction-list/filters/index.jsx - About 1 hr to fix

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

                          render() {
                            const {
                              balance,
                              currency,
                              spendToday,
                        Severity: Minor
                        Found in src/common/components/balance/index.jsx - About 1 hr to fix

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

                            getControlId() {
                              const {
                                label,
                                placeholder,
                              } = this.props;
                          Severity: Major
                          Found in src/common/components/form/select.jsx and 2 other locations - About 1 hr to fix
                          src/common/components/form/date.jsx on lines 53..60
                          src/common/components/form/field.jsx on lines 42..49

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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language