balanced/balanced-dashboard

View on GitHub

Showing 243 of 243 total issues

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

    isDescending: function() {
        return this.get("isCurrentColumn") && this.get("sortDirection") === "desc";
    }.property("isCurrentColumn", "sortDirection"),
Severity: Major
Found in app/views/results/results-loader-sort-column-header.js and 3 other locations - About 35 mins to fix
app/views/results/results-loader-sort-column-header.js on lines 15..17
app/views/results/search-results-loader-sort-column-header.js on lines 16..18
app/views/results/search-results-loader-sort-column-header.js on lines 20..22

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

            productionUncached: {
                options: {
                    bucket: 'balanced-dashboard',
                },
                headers: {
Severity: Minor
Found in Gruntfile.js and 1 other location - About 35 mins to fix
Gruntfile.js on lines 80..91

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

    expiration_month: function() {
        var match = this.getExpirationDateMatch();
        if (match) {
            return match[1];
        }
Severity: Minor
Found in app/models/factories/debit-card-transaction-factory.js and 1 other location - About 35 mins to fix
app/models/factories/debit-card-transaction-factory.js on lines 63..68

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 4 locations. Consider refactoring.
Open

CreditCustomerModalView.reopenClass({
    open: function(customer, order) {
        return this.create({
            customer: customer,
            order: order
Severity: Major
Found in app/views/modals/credit-customer-modal.js and 3 other locations - About 35 mins to fix
app/views/modals/credit-order-modal.js on lines 65..72
app/views/modals/debit-customer-modal.js on lines 41..48
app/views/modals/marketplace-delete-modal.js on lines 44..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 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

    expiration_year: function() {
        var match = this.getExpirationDateMatch();
        if (match) {
            return match[2];
        }
Severity: Minor
Found in app/models/factories/debit-card-transaction-factory.js and 1 other location - About 35 mins to fix
app/models/factories/debit-card-transaction-factory.js on lines 56..61

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

    actions: {
        delete: function(userInvite) {
            this.get("container").lookup("controller:application")
                .send("openModal", "modals/marketplace-user-delete-modal", userInvite);
        }
Severity: Minor
Found in app/components/users-table.js and 1 other location - About 35 mins to fix
app/components/api-keys-table.js on lines 13..17

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 4 locations. Consider refactoring.
Open

    isDescending: function() {
        return this.get("isCurrentColumn") && this.get("sortDirection") === "desc";
    }.property("isCurrentColumn", "sortDirection"),
Severity: Major
Found in app/views/results/search-results-loader-sort-column-header.js and 3 other locations - About 35 mins to fix
app/views/results/results-loader-sort-column-header.js on lines 15..17
app/views/results/results-loader-sort-column-header.js on lines 19..21
app/views/results/search-results-loader-sort-column-header.js on lines 16..18

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 4 locations. Consider refactoring.
Open

    isAscending: function() {
        return this.get("isCurrentColumn") && this.get("sortDirection") === "asc";
    }.property("isCurrentColumn", "sortDirection"),
Severity: Major
Found in app/views/results/search-results-loader-sort-column-header.js and 3 other locations - About 35 mins to fix
app/views/results/results-loader-sort-column-header.js on lines 15..17
app/views/results/results-loader-sort-column-header.js on lines 19..21
app/views/results/search-results-loader-sort-column-header.js on lines 20..22

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

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

    filters: function() {
        return [
            defineFilter("All", undefined, true),
            defineFilter("Pending", "pending"),
            defineFilter("Succeeded", "succeeded"),
app/views/results/search-transactions-status-results-dropdown-filter.js on lines 8..15

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 "created";
Severity: Major
Found in app/models/hold.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return false;
    Severity: Major
    Found in app/lib/errors-logger.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return error.errors.every(function(err) {
                      return ErrorsLogger.isExpectedStatusCode(err.status_code);
                  });
      Severity: Major
      Found in app/lib/errors-logger.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return "pending";
        Severity: Major
        Found in app/models/bank-account.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return undefined;
          Severity: Major
          Found in app/models/credit.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return false;
            Severity: Major
            Found in app/lib/errors-logger.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return "The transaction failed. No failure reason was given.";
              Severity: Major
              Found in app/models/credit.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return "unverified";
                Severity: Major
                Found in app/models/bank-account.js - About 30 mins to fix

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

                      setModelValue: function(value) {
                          var model = this.get("model");
                          var field = this.get("field");
                          return model.set(field, value);
                      },
                  Severity: Minor
                  Found in app/views/form-fields/checkbox-form-field.js and 1 other location - About 30 mins to fix
                  app/models/results-loaders/marketplace-search.js on lines 42..46

                  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

                          } else {
                              var uri = this.get('resultsUri');
                              var type = this.get('resultsType');
                              return SearchModelArray.newArrayLoadedFromUri(uri, type);
                          }
                  Severity: Minor
                  Found in app/models/results-loaders/marketplace-search.js and 1 other location - About 30 mins to fix
                  app/views/form-fields/checkbox-form-field.js on lines 12..16

                  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 click has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      click: function(e) {
                          var sortField = this.get('controller.sortField');
                          var sortOrder = this.get('controller.sortOrder');
                          var allowSortByNone = this.get('controller.allowSortByNone');
                          var nextSortOrder = 'desc';
                  Severity: Minor
                  Found in app/views/results/results-sortable-column-header.js - 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