polkadot-js/extension

View on GitHub

Showing 196 of 196 total issues

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

        <FontAwesomeIcon
          className={`arrowLeft ${previousClickActive ? 'active' : ''}`}
          icon={faArrowLeft}
          onClick={prevClick}
          size='sm'
Severity: Minor
Found in packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx and 2 other locations - About 40 mins to fix
packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx on lines 49..54
packages/extension-ui/src/partials/Header.tsx on lines 139..144

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

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

        <ActionBar className='btnReject'>
          <Link
            isDanger
            onClick={_onReject}
          >
Severity: Minor
Found in packages/extension-ui/src/Popup/Metadata/Request.tsx and 1 other location - About 40 mins to fix
packages/extension-ui/src/Popup/Signing/Request/SignArea.tsx on lines 121..128

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

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 createAccountSuri has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

export async function createAccountSuri (name: string, password: string, suri: string, type?: KeypairType, genesisHash?: HexString | null): Promise<boolean> {
Severity: Minor
Found in packages/extension-ui/src/messaging.ts - About 35 mins to fix

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

        it('shows seed phrase in a span inside a div', () => {
          expect(wrapper.find('.seedBox span').text()).toBe(exampleAccount.seed);
        });
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 95..97
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 99..101
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 103..105
    packages/extension-ui/src/components/Address.spec.tsx on lines 320..322

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

        it('shows the account correctly reencoded', () => {
          expect(wrapper.find('[data-field="address"]').text()).toEqual(westEndAccount.expectedEncodedAddress);
        });
    Severity: Major
    Found in packages/extension-ui/src/components/Address.spec.tsx and 4 other locations - About 35 mins to fix
    packages/extension-ui/src/Popup/CreateAccount/CreateAccount.spec.tsx on lines 72..74
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 95..97
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 99..101
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 103..105

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

        it('shows the correct name', () => {
          expect(wrapper.find('Name span').text()).toEqual(mockedAccount.name);
        });
    Severity: Major
    Found in packages/extension-ui/src/Popup/ImportQr.spec.tsx and 4 other locations - About 35 mins to fix
    packages/extension-ui/src/Popup/CreateAccount/CreateAccount.spec.tsx on lines 72..74
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 99..101
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 103..105
    packages/extension-ui/src/components/Address.spec.tsx on lines 320..322

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

        expect(wrapper.find(InputWithLabel).find('[data-input-repeat-password]').find(Input).prop('withError')).toBe(false);
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 90..90
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 95..95
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 105..105
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 130..130
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 140..140

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

        it('shows the correct address', () => {
          expect(wrapper.find('[data-field="address"]').text()).toEqual(mockedAccount.content);
        });
    Severity: Major
    Found in packages/extension-ui/src/Popup/ImportQr.spec.tsx and 4 other locations - About 35 mins to fix
    packages/extension-ui/src/Popup/CreateAccount/CreateAccount.spec.tsx on lines 72..74
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 95..97
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 103..105
    packages/extension-ui/src/components/Address.spec.tsx on lines 320..322

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

        expect(wrapper.find(InputWithLabel).find('[data-input-name]').find(Input).prop('withError')).toBe(true);
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 90..90
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 105..105
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 130..130
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 140..140
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 147..147

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

        expect(wrapper.find(InputWithLabel).find('[data-input-name]').find(Input).prop('withError')).toBe(true);
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 90..90
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 95..95
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 130..130
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 140..140
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 147..147

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

        expect(wrapper.find(InputWithLabel).find('[data-input-name]').find(Input).prop('withError')).toBe(false);
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 95..95
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 105..105
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 130..130
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 140..140
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 147..147

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

        expect(wrapper.find(InputWithLabel).find('[data-input-repeat-password]').find(Input).prop('withError')).toBe(true);
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 90..90
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 95..95
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 105..105
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 130..130
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 147..147

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

        expect(wrapper.find(InputWithLabel).find('[data-input-password]').find(Input).prop('withError')).toBe(true);
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 90..90
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 95..95
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 105..105
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 140..140
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 147..147

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

        it('shows the correct banner', () => {
          expect(wrapper.find('[data-field="chain"]').text()).toEqual(mockedAccount.expectedBannerChain);
        });
    Severity: Major
    Found in packages/extension-ui/src/Popup/ImportQr.spec.tsx and 4 other locations - About 35 mins to fix
    packages/extension-ui/src/Popup/CreateAccount/CreateAccount.spec.tsx on lines 72..74
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 95..97
    packages/extension-ui/src/Popup/ImportQr.spec.tsx on lines 99..101
    packages/extension-ui/src/components/Address.spec.tsx on lines 320..322

    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

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

    export async function getMetadata (genesisHash?: string | null, isPartial = false): Promise<Chain | null> {
      if (!genesisHash) {
        return null;
      }
    
    
    Severity: Minor
    Found in packages/extension-ui/src/messaging.ts - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    function MenuAdd ({ className, reference }: Props): React.ReactElement<Props> {
      const { t } = useTranslation();
      const { master } = useContext(AccountContext);
      const mediaAllowed = useContext(MediaContext);
      const { isLedgerCapable, isLedgerEnabled } = useLedger();
    Severity: Minor
    Found in packages/extension-ui/src/partials/MenuAdd.tsx - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

                    <AccountNamePasswordCreation
                      buttonLabel={t('Add the account with the generated seed')}
                      isBusy={isBusy}
                      onBackClick={_onPreviousStep}
                      onCreate={_onCreate}
    Severity: Minor
    Found in packages/extension-ui/src/Popup/CreateAccount/index.tsx and 2 other locations - About 35 mins to fix
    packages/extension-ui/src/Popup/Derive/index.tsx on lines 91..97
    packages/extension-ui/src/Popup/ImportSeed/index.tsx on lines 91..97

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

              <AccountNamePasswordCreation
                buttonLabel={t('Create derived account')}
                isBusy={isBusy}
                onBackClick={_onBackClick}
                onCreate={_onCreate}
    Severity: Minor
    Found in packages/extension-ui/src/Popup/Derive/index.tsx and 2 other locations - About 35 mins to fix
    packages/extension-ui/src/Popup/CreateAccount/index.tsx on lines 120..126
    packages/extension-ui/src/Popup/ImportSeed/index.tsx on lines 91..97

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

              <AccountNamePasswordCreation
                buttonLabel={t('Add the account with the supplied seed')}
                isBusy={isBusy}
                onBackClick={_onBackClick}
                onCreate={_onCreate}
    Severity: Minor
    Found in packages/extension-ui/src/Popup/ImportSeed/index.tsx and 2 other locations - About 35 mins to fix
    packages/extension-ui/src/Popup/CreateAccount/index.tsx on lines 120..126
    packages/extension-ui/src/Popup/Derive/index.tsx on lines 91..97

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

      const enterName = (name: string): Promise<void> => type(wrapper.find('input').first(), name);
    Severity: Major
    Found in packages/extension-ui/src/Popup/Derive/Derive.spec.tsx and 3 other locations - About 30 mins to fix
    packages/extension-ui/src/Popup/CreateAccount/CreateAccount.spec.tsx on lines 58..58
    packages/extension-ui/src/Popup/ImportSeed/ImportSeed.spec.tsx on lines 71..71
    packages/extension-ui/src/components/AccountNamePasswordCreation.spec.tsx on lines 51..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 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

    Severity
    Category
    Status
    Source
    Language