polkadot-js/apps

View on GitHub

Showing 2,050 of 2,050 total issues

Avoid too many return statements within this function.
Open

    return false;
Severity: Major
Found in packages/apps-routing/src/stakingLegacy.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return findMissingApis(api, needsApi, needsApiInstances, needsApiCheck).length === 0;
    Severity: Major
    Found in packages/apps/src/Menu/index.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return false;
      Severity: Major
      Found in packages/apps/src/Menu/index.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return `{${[...value.entries()]
              .map(([k, v]) => `${(k as string).toString()}: ${format(v)}`)
              .join(', ')}}`;
        Severity: Major
        Found in packages/page-js/src/Output.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return true;
          Severity: Major
          Found in packages/react-components/src/AddressInfo.tsx - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return <div>{item.value.toString().split(',').join(', ')}</div>;
            Severity: Major
            Found in packages/page-explorer/src/BlockInfo/Logs.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return (value as string).toString();
              Severity: Major
              Found in packages/page-js/src/Output.tsx - About 30 mins to fix

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

                export function aliceSigner (): KeyringPair {
                  const keyring = new Keyring({ type: 'sr25519' });
                
                  return keyring.addFromUri('//Alice');
                }
                Severity: Major
                Found in packages/test-support/src/keyring/signers.ts and 5 other locations - About 30 mins to fix
                packages/test-support/src/keyring/signers.ts on lines 14..18
                packages/test-support/src/keyring/signers.ts on lines 20..24
                packages/test-support/src/keyring/signers.ts on lines 26..30
                packages/test-support/src/keyring/signers.ts on lines 32..36
                packages/test-support/src/keyring/signers.ts on lines 38..42

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                export function charlieSigner (): KeyringPair {
                  const keyring = new Keyring({ type: 'sr25519' });
                
                  return keyring.addFromUri('//Charlie');
                }
                Severity: Major
                Found in packages/test-support/src/keyring/signers.ts and 5 other locations - About 30 mins to fix
                packages/test-support/src/keyring/signers.ts on lines 8..12
                packages/test-support/src/keyring/signers.ts on lines 14..18
                packages/test-support/src/keyring/signers.ts on lines 26..30
                packages/test-support/src/keyring/signers.ts on lines 32..36
                packages/test-support/src/keyring/signers.ts on lines 38..42

                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

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

                function assignValue ({ isStashNominating, isStashValidating }: StakerState): number {
                  return isStashValidating
                    ? 1
                    : isStashNominating
                      ? 5
                Severity: Minor
                Found in packages/page-staking-legacy/src/Actions/index.tsx and 1 other location - About 30 mins to fix
                packages/page-staking/src/Actions/index.tsx on lines 44..50

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                export function daveSigner (): KeyringPair {
                  const keyring = new Keyring({ type: 'sr25519' });
                
                  return keyring.addFromUri('//Dave');
                }
                Severity: Major
                Found in packages/test-support/src/keyring/signers.ts and 5 other locations - About 30 mins to fix
                packages/test-support/src/keyring/signers.ts on lines 8..12
                packages/test-support/src/keyring/signers.ts on lines 14..18
                packages/test-support/src/keyring/signers.ts on lines 20..24
                packages/test-support/src/keyring/signers.ts on lines 32..36
                packages/test-support/src/keyring/signers.ts on lines 38..42

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                export function ferdieSigner (): KeyringPair {
                  const keyring = new Keyring({ type: 'sr25519' });
                
                  return keyring.addFromUri('//Ferdie');
                }
                Severity: Major
                Found in packages/test-support/src/keyring/signers.ts and 5 other locations - About 30 mins to fix
                packages/test-support/src/keyring/signers.ts on lines 8..12
                packages/test-support/src/keyring/signers.ts on lines 14..18
                packages/test-support/src/keyring/signers.ts on lines 20..24
                packages/test-support/src/keyring/signers.ts on lines 26..30
                packages/test-support/src/keyring/signers.ts on lines 32..36

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                export function bobSigner (): KeyringPair {
                  const keyring = new Keyring({ type: 'sr25519' });
                
                  return keyring.addFromUri('//Bob');
                }
                Severity: Major
                Found in packages/test-support/src/keyring/signers.ts and 5 other locations - About 30 mins to fix
                packages/test-support/src/keyring/signers.ts on lines 8..12
                packages/test-support/src/keyring/signers.ts on lines 20..24
                packages/test-support/src/keyring/signers.ts on lines 26..30
                packages/test-support/src/keyring/signers.ts on lines 32..36
                packages/test-support/src/keyring/signers.ts on lines 38..42

                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

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

                export interface PayoutValidator {
                  available: BN;
                  eras: PayoutEraValidator[];
                  validatorId: string;
                  total: BN;
                Severity: Minor
                Found in packages/page-staking-legacy/src/Payouts/types.ts and 1 other location - About 30 mins to fix
                packages/page-staking/src/Payouts/types.ts on lines 13..18

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 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

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

                export interface PayoutValidator {
                  available: BN;
                  eras: PayoutEraValidator[];
                  validatorId: string;
                  total: BN;
                Severity: Minor
                Found in packages/page-staking/src/Payouts/types.ts and 1 other location - About 30 mins to fix
                packages/page-staking-legacy/src/Payouts/types.ts on lines 13..18

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 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

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

                interface Props {
                  buttons: React.ReactNode;
                  councilId: string | null;
                  councilThreshold: number;
                  slash: SlashEra;
                Severity: Minor
                Found in packages/page-staking-legacy/src/Slashes/Era.tsx and 1 other location - About 30 mins to fix
                packages/page-staking/src/Slashes/Era.tsx on lines 17..22

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 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

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

                      const collectionInfos = details[0][0].map((id, index) =>
                        extractInfo(allAccounts, id, details[1][index], metadata[1][index])
                      );
                Severity: Minor
                Found in packages/page-nfts/src/useCollectionInfos.ts and 1 other location - About 30 mins to fix
                packages/page-assets/src/useAssetInfos.ts on lines 61..63

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                export function eveSigner (): KeyringPair {
                  const keyring = new Keyring({ type: 'sr25519' });
                
                  return keyring.addFromUri('//Eve');
                }
                Severity: Major
                Found in packages/test-support/src/keyring/signers.ts and 5 other locations - About 30 mins to fix
                packages/test-support/src/keyring/signers.ts on lines 8..12
                packages/test-support/src/keyring/signers.ts on lines 14..18
                packages/test-support/src/keyring/signers.ts on lines 20..24
                packages/test-support/src/keyring/signers.ts on lines 26..30
                packages/test-support/src/keyring/signers.ts on lines 38..42

                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

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

                function assignValue ({ isStashNominating, isStashValidating }: StakerState): number {
                  return isStashValidating
                    ? 1
                    : isStashNominating
                      ? 5
                Severity: Minor
                Found in packages/page-staking/src/Actions/index.tsx and 1 other location - About 30 mins to fix
                packages/page-staking-legacy/src/Actions/index.tsx on lines 44..50

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                        {message.isPayable && (
                          <InputBalance
                            isError={!isValueValid}
                            isZeroable
                            label={t('value')}
                Severity: Minor
                Found in packages/page-contracts/src/Contracts/Call.tsx and 2 other locations - About 30 mins to fix
                packages/page-contracts/src/Codes/Upload.tsx on lines 218..226
                packages/page-contracts/src/Contracts/Deploy.tsx on lines 172..180

                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