polkadot-js/apps

View on GitHub
packages/page-accounts/src/Accounts/index.spec.ts

Summary

Maintainability
F
6 days
Test Coverage

File index.spec.ts has 397 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2017-2024 @polkadot/app-accounts authors & contributors
// SPDX-License-Identifier: Apache-2.0

/// <reference types="@polkadot/dev-test/globals.d.ts" />

Severity: Minor
Found in packages/page-accounts/src/Accounts/index.spec.ts - About 5 hrs to fix

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

        it('account rows display the details balance info', async () => {
          accountsPage.renderAccountsWithDefaultAddresses(
            anAccountWithBalance({ freeBalance: balance(500), lockedBalance: balance(30) }),
            anAccountWithBalance({ availableBalance: balance(50), freeBalance: balance(200), reservedBalance: balance(150) })
          );
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 1 other location - About 1 day to fix
    packages/page-addresses/src/Contacts/index.spec.ts on lines 89..103

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

    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

        it('account rows display the total balance info', async () => {
          accountsPage.renderAccountsWithDefaultAddresses(
            anAccountWithBalance({ freeBalance: balance(500) }),
            anAccountWithBalance({ freeBalance: balance(200), reservedBalance: balance(150) })
          );
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 1 other location - About 4 hrs to fix
    packages/page-addresses/src/Contacts/index.spec.ts on lines 76..86

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

    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

          it('proxy overview', async () => {
            await accountRows[0].assertBadge('sitemap-badge');
            const badgePopup = getPopupById(/sitemap-badge-hover.*/);
            const proxyOverviewToggle = await within(badgePopup).findByText('Manage proxies');
    
    
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 2 other locations - About 4 hrs to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 494..504
    packages/page-accounts/src/Accounts/index.spec.ts on lines 506..516

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

    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

          it('multisig approvals', async () => {
            await accountRows[0].assertBadge('file-signature-badge');
            const badgePopup = getPopupById(/file-signature-badge-hover.*/);
            const approvalsModalToggle = await within(badgePopup).findByText('View pending approvals');
    
    
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 2 other locations - About 4 hrs to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 506..516
    packages/page-accounts/src/Accounts/index.spec.ts on lines 518..528

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

    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

          it('delegate democracy vote', async () => {
            await accountRows[0].assertBadge('calendar-check-badge');
            const badgePopup = getPopupById(/calendar-check-badge-hover.*/);
            const delegateModalToggle = await within(badgePopup).findByText('Manage delegation');
    
    
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 2 other locations - About 4 hrs to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 494..504
    packages/page-accounts/src/Accounts/index.spec.ts on lines 518..528

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

    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

        it('account details rows toggled on icon toggle click', async () => {
          accountsPage.renderDefaultAccounts(1);
          const row = (await accountsPage.getAccountRows())[0];
    
          expect(row.detailsRow).toHaveClass('isCollapsed');
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 1 other location - About 2 hrs to fix
    packages/page-addresses/src/Contacts/index.spec.ts on lines 127..136

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

    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

        it('displays transferable summary', async () => {
          accountsPage.renderAccountsWithDefaultAddresses(
            anAccountWithBalance({ availableBalance: balance(400) }),
            anAccountWithBalance({ availableBalance: balance(600) })
          );
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 2 other locations - About 2 hrs to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 219..228
    packages/page-accounts/src/Accounts/index.spec.ts on lines 282..291

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

    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

        it('displays redeemable summary', async () => {
          accountsPage.renderAccountsWithDefaultAddresses(
            anAccountWithStaking({ redeemable: balance(4000) }),
            anAccountWithStaking({ redeemable: balance(5000) })
          );
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 2 other locations - About 2 hrs to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 208..217
    packages/page-accounts/src/Accounts/index.spec.ts on lines 219..228

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

    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

        it('displays locked summary', async () => {
          accountsPage.renderAccountsWithDefaultAddresses(
            anAccountWithBalance({ lockedBalance: balance(400) }),
            anAccountWithBalance({ lockedBalance: balance(600) })
          );
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 2 other locations - About 2 hrs to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 208..217
    packages/page-accounts/src/Accounts/index.spec.ts on lines 282..291

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

    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

      beforeAll(async () => {
        await i18next.changeLanguage('en');
    
        if (keyring.getAccounts().length === 0) {
          keyring.loadAll({ isDevelopment: true, store: new MemoryStore() });
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 2 other locations - About 1 hr to fix
    packages/page-addresses/src/Contacts/index.spec.ts on lines 23..29
    packages/react-components/src/AccountSidebar/Sidebar.spec.tsx on lines 27..33

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

    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

            anAccountWithStaking({
              unlocking: [
                {
                  remainingEras: new BN('1000000000'),
                  value: balance(100)
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 1 other location - About 1 hr to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 243..258

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

    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

            anAccountWithStaking({
              unlocking: [
                {
                  remainingEras: new BN('1000000000'),
                  value: balance(200)
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 1 other location - About 1 hr to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 259..274

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

    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

        it('the accounts table contains some account rows', async () => {
          accountsPage.renderDefaultAccounts(2);
          const accountRows = await accountsPage.getAccountRows();
    
          expect(accountRows).toHaveLength(2);
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 1 other location - About 1 hr to fix
    packages/page-addresses/src/Contacts/index.spec.ts on lines 67..73

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

    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

        it('when account is not tagged, account row details displays none info', async () => {
          accountsPage.renderDefaultAccounts(1);
          const rows = await accountsPage.getAccountRows();
    
          await rows[0].assertTags('none');
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 1 other location - About 1 hr to fix
    packages/page-addresses/src/Contacts/index.spec.ts on lines 106..111

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

    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

          it('sorts by name if asked', async () => {
            await accountsPage.sortBy('name');
            await accountsTable.assertRowsOrder([3, 2, 1]);
          });
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 3 other locations - About 35 mins to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 334..337
    packages/page-accounts/src/Accounts/index.spec.ts on lines 346..349
    packages/page-accounts/src/Accounts/index.spec.ts on lines 352..355

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

    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

          it('sorts by date if asked', async () => {
            await accountsPage.sortBy('date');
            await accountsTable.assertRowsOrder([3, 1, 2]);
          });
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 3 other locations - About 35 mins to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 334..337
    packages/page-accounts/src/Accounts/index.spec.ts on lines 340..343
    packages/page-accounts/src/Accounts/index.spec.ts on lines 352..355

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

    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

          it('sorts by parent if asked', async () => {
            await accountsPage.sortBy('parent');
            await accountsTable.assertRowsOrder([3, 1, 2]);
          });
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 3 other locations - About 35 mins to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 340..343
    packages/page-accounts/src/Accounts/index.spec.ts on lines 346..349
    packages/page-accounts/src/Accounts/index.spec.ts on lines 352..355

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

    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

          it('sorts by balances if asked', async () => {
            await accountsPage.sortBy('balances');
            await accountsTable.assertRowsOrder([1, 2, 3]);
          });
    Severity: Major
    Found in packages/page-accounts/src/Accounts/index.spec.ts and 3 other locations - About 35 mins to fix
    packages/page-accounts/src/Accounts/index.spec.ts on lines 334..337
    packages/page-accounts/src/Accounts/index.spec.ts on lines 340..343
    packages/page-accounts/src/Accounts/index.spec.ts on lines 346..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 47.

    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