balanced/balanced-dashboard

View on GitHub

Showing 243 of 243 total issues

Function ajax has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ajax: function(url, type, settings) {
        settings = settings || {};
        settings.url = url;
        settings.type = type;
        settings.context = this;
Severity: Minor
Found in app/adapters/ajax.js - About 1 hr to fix

    Function signInRequest has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        signInRequest: function(options) {
            var self = this;
            var attributes = _.extend({}, {
                url: ENV.BALANCED.AUTH + '/logins',
                type: 'POST'
    Severity: Minor
    Found in app/auth.js - About 1 hr to fix

      Function save has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          save: function() {
              var deferred = Ember.RSVP.defer();
      
              var baseDebitAttributes = this.getDebitAttributes();
              var self = this;
      Severity: Minor
      Found in app/models/factories/debit-card-transaction-factory.js - About 1 hr to fix

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

            amount_dollars: function() {
                if (this.get('amount')) {
                    return (this.get('amount') / 100).toFixed(2);
                } else {
                    return '';
        Severity: Major
        Found in app/models/transaction.js and 1 other location - About 1 hr to fix
        app/models/dispute.js on lines 53..59

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

        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

                signUp: function() {
                    AnalyticsLogger.trackEvent("SignUp: Opened 'Create an account' modal", {
                        path: this.get("container").lookup("controller:application").get('currentRouteName')
                    });
                    this.transitionToRoute('setup_guest_user');
        Severity: Major
        Found in app/controllers/application.js and 1 other location - About 1 hr to fix
        app/controllers/application.js on lines 15..20

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

        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

                register: function() {
                    AnalyticsLogger.trackEvent("SignUp: Opened 'Register for production access' modal", {
                        path: this.get("container").lookup("controller:application").get('currentRouteName')
                    });
                    this.transitionToRoute('marketplaces.apply');
        Severity: Major
        Found in app/controllers/application.js and 1 other location - About 1 hr to fix
        app/controllers/application.js on lines 8..13

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

        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

            amount_dollars: function() {
                if (this.get('amount')) {
                    return (this.get('amount') / 100).toFixed(2);
                } else {
                    return '';
        Severity: Major
        Found in app/models/dispute.js and 1 other location - About 1 hr to fix
        app/models/transaction.js on lines 14..20

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

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

            validateAndSave: function(settings) {
                this.get("validationErrors").clear();
                this.validate();
                if (this.get("isValid")) {
                    var Adapter = this.constructor.getAdapter();
        Severity: Minor
        Found in app/models/core/model.js - About 1 hr to fix

          Function belongsTo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              belongsTo: function(propertyName, defaultType) {
                  defaultType = defaultType || 'model';
          
                  var embeddedProperty = JSON_PROPERTY_KEY + '.' + propertyName;
                  var uriProperty = propertyName + URI_POSTFIX;
          Severity: Minor
          Found in app/models/core/model.js - About 1 hr to fix

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

                        }, {
                            className: "succeeded-bank-account-credit-details-row",
                            primary: "Credit",
                            secondary: "Succeeded",
                            quantity: "bank_account_credits_count",
            Severity: Major
            Found in app/views/results/invoice-table.js and 1 other location - About 1 hr to fix
            app/views/results/invoice-table.js on lines 82..90

            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

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

                        }, {
                            className: "succeeded-card-credit-details-row",
                            primary: "Credit",
                            secondary: "Push to card",
                            quantity: "card_credits_count",
            Severity: Major
            Found in app/views/results/invoice-table.js and 1 other location - About 1 hr to fix
            app/views/results/invoice-table.js on lines 74..82

            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

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

            DebitFundingInstrumentModalView.reopenClass({
                open: function(fundingInstrument) {
                    var debit = DebitExistingFundingInstrumentTransactionFactory.create({
                        source: fundingInstrument
                    });
            Severity: Major
            Found in app/views/modals/debit-funding-instrument-modal.js and 2 other locations - About 1 hr to fix
            app/views/modals/credit-funding-instrument-modal.js on lines 20..29
            app/views/modals/hold-card-modal.js on lines 12..21

            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

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

            CreditFundingInstrumentModalView.reopenClass({
                open: function(fundingInstrument) {
                    var credit = CreditExistingFundingInstrumentTransactionFactory.create({
                        destination: fundingInstrument
                    });
            Severity: Major
            Found in app/views/modals/credit-funding-instrument-modal.js and 2 other locations - About 1 hr to fix
            app/views/modals/debit-funding-instrument-modal.js on lines 19..28
            app/views/modals/hold-card-modal.js on lines 12..21

            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

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

            HoldCardModalView.reopenClass({
                open: function(card) {
                    var hold = HoldExistingFundingInstrumentTransactionFactory.create({
                        source: card
                    });
            Severity: Major
            Found in app/views/modals/hold-card-modal.js and 2 other locations - About 1 hr to fix
            app/views/modals/credit-funding-instrument-modal.js on lines 20..29
            app/views/modals/debit-funding-instrument-modal.js on lines 19..28

            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

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

                resultsType: function() {
                    var mapping = {
                        "funding_instrument": FundingInstrument,
                        "customer": Customer,
                        "order": Order
            Severity: Major
            Found in app/models/results-loaders/marketplace-search.js and 1 other location - About 1 hr to fix
            app/models/results-loaders/marketplace-search.js on lines 18..26

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

            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

                type: function() {
                    var mapping = {
                        "funding_instrument": FUNDING_INSTRUMENT_TYPES,
                        "customer": CUSTOMER_TYPES,
                        "order": ORDER_TYPES
            Severity: Major
            Found in app/models/results-loaders/marketplace-search.js and 1 other location - About 1 hr to fix
            app/models/results-loaders/marketplace-search.js on lines 28..35

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

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

                    save: function() {
                        this.get('model').validate();
                        if (this.get('model').get("isValid")) {
                            var formData = new FormData();
                            formData.append('note', this.get('model.note'));
            Severity: Minor
            Found in app/views/modals/evidence-portal-modal.js - About 1 hr to fix

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

                  getTransactionsLoader: function(attributes) {
                      var DisputeTransactionsResultsLoader = require("balanced-dashboard/models/results-loaders/dispute-transactions")["default"];
                      attributes = _.extend({
                          dispute: this
                      }, attributes);
              Severity: Major
              Found in app/models/dispute.js and 1 other location - About 1 hr to fix
              app/models/invoice.js on lines 65..71

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

                  actions: {
                      setFilter: function(filterLink) {
                          var controller = this.get('controller');
                          controller.send('changePaymentMethodFilter', filterLink.value);
                          this.toggleSelected(filterLink);
              app/views/results/disputes-status-results-dropdown-filter.js on lines 15..21
              app/views/results/transactions-status-results-dropdown-filter.js on lines 15..21
              app/views/results/transactions-type-results-dropdown-filter.js on lines 17..23

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

                  actions: {
                      setFilter: function(filterLink) {
                          var controller = this.get('controller');
                          controller.send('changeDisputeStatusFilter', filterLink.value);
                          this.toggleSelected(filterLink);
              app/views/results/payment-methods-results-dropdown-filter.js on lines 14..20
              app/views/results/transactions-status-results-dropdown-filter.js on lines 15..21
              app/views/results/transactions-type-results-dropdown-filter.js on lines 17..23

              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

              Severity
              Category
              Status
              Source
              Language