polkadot-js/apps

View on GitHub

Showing 2,080 of 2,080 total issues

Function calculateOptions has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function calculateOptions (aspectRatio: number, values: Value[], jsonValues: string, max: number, showLabels: boolean): State {
Severity: Minor
Found in packages/react-components/src/Chart/HorizBar.tsx - About 35 mins to fix

    Function getValuesFromBn has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function getValuesFromBn (valueBn: BN, si: SiDef | null, isSigned: boolean, isZeroable: boolean, _decimals?: number): [string, BN, boolean] {
    Severity: Minor
    Found in packages/react-components/src/InputNumber.tsx - About 35 mins to fix

      Function isValidNumber has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function isValidNumber (bn: BN, bitLength: BitLength, isSigned: boolean, isZeroable: boolean, maxValue?: BN | null): boolean {
      Severity: Minor
      Found in packages/react-components/src/InputNumber.tsx - About 35 mins to fix

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

          const [{ imageLen, imageLenDefault, isImageLenValid }, setImageLen] = useState<ImageState>({ imageLen: BN_ZERO, isImageLenValid: false });
        Severity: Minor
        Found in packages/page-democracy/src/Overview/Propose.tsx and 2 other locations - About 35 mins to fix
        packages/page-council/src/Motions/ProposeExternal.tsx on lines 46..46
        packages/page-referenda/src/Referenda/Submit/index.tsx on lines 50..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 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

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

          const [{ imageLen, imageLenDefault, isImageLenValid }, setImageLen] = useState<ImageState>({ imageLen: BN_ZERO, isImageLenValid: false });
        Severity: Minor
        Found in packages/page-council/src/Motions/ProposeExternal.tsx and 2 other locations - About 35 mins to fix
        packages/page-democracy/src/Overview/Propose.tsx on lines 38..38
        packages/page-referenda/src/Referenda/Submit/index.tsx on lines 50..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 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 3 locations. Consider refactoring.
        Open

                          <Dropdown
                            defaultValue={eras[0].value}
                            label={t('the era to cancel for')}
                            onChange={setSelectedEra}
                            options={eras}
        Severity: Minor
        Found in packages/page-council/src/Motions/Slashing.tsx and 2 other locations - About 35 mins to fix
        packages/page-parachains/src/Teleport.tsx on lines 152..157
        packages/page-referenda/src/Referenda/Submit/index.tsx on lines 191..196

        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

          {
            homepage: 'https://clover.finance',
            info: 'clover',
            paraId: 2002,
            providers: {
        Severity: Major
        Found in packages/apps-config/src/endpoints/productionRelayPolkadot.ts and 3 other locations - About 35 mins to fix
        packages/apps-config/src/endpoints/productionRelayKusama.ts on lines 367..380
        packages/apps-config/src/endpoints/productionRelayKusama.ts on lines 454..467
        packages/apps-config/src/endpoints/productionRelayPolkadot.ts on lines 376..389

        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

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

          const [{ imageLen, imageLenDefault, isImageLenValid }, setImageLen] = useState<ImageState>({ imageLen: BN_ZERO, isImageLenValid: false });
        Severity: Minor
        Found in packages/page-referenda/src/Referenda/Submit/index.tsx and 2 other locations - About 35 mins to fix
        packages/page-council/src/Motions/ProposeExternal.tsx on lines 46..46
        packages/page-democracy/src/Overview/Propose.tsx on lines 38..38

        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

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

          const _onChangeImageHash = useCallback(
            (h?: string) =>
              setImageHash({
                imageHash: h as HexString,
                isImageHashValid: isHex(h, 256)
        Severity: Minor
        Found in packages/page-democracy/src/Overview/Propose.tsx and 1 other location - About 35 mins to fix
        packages/page-referenda/src/Referenda/Submit/index.tsx on lines 133..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 3 locations. Consider refactoring.
        Open

          const _onChangeName = useCallback(
            (name: string) => setName({ isNameValid: !!name.trim(), name }),
            []
          );
        Severity: Minor
        Found in packages/page-addresses/src/modals/Create.tsx and 2 other locations - About 35 mins to fix
        packages/page-accounts/src/modals/Ledger.tsx on lines 78..81
        packages/page-accounts/src/modals/Qr.tsx on lines 52..55

        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

          {
            homepage: 'https://integritee.network',
            info: 'integritee',
            paraId: 2039,
            providers: {
        Severity: Major
        Found in packages/apps-config/src/endpoints/productionRelayPolkadot.ts and 3 other locations - About 35 mins to fix
        packages/apps-config/src/endpoints/productionRelayKusama.ts on lines 367..380
        packages/apps-config/src/endpoints/productionRelayKusama.ts on lines 454..467
        packages/apps-config/src/endpoints/productionRelayPolkadot.ts on lines 151..164

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

          const _onChangeName = useCallback(
            (name: string) => setName({ isNameValid: !!name.trim(), name }),
            []
          );
        Severity: Minor
        Found in packages/page-accounts/src/modals/Ledger.tsx and 2 other locations - About 35 mins to fix
        packages/page-accounts/src/modals/Qr.tsx on lines 52..55
        packages/page-addresses/src/modals/Create.tsx on lines 79..82

        Duplicated Code

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

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

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

        Tuning

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

          {
            homepage: 'https://dico.io/',
            info: 'kico',
            paraId: 2107,
            providers: {
        Severity: Major
        Found in packages/apps-config/src/endpoints/productionRelayKusama.ts and 3 other locations - About 35 mins to fix
        packages/apps-config/src/endpoints/productionRelayKusama.ts on lines 454..467
        packages/apps-config/src/endpoints/productionRelayPolkadot.ts on lines 151..164
        packages/apps-config/src/endpoints/productionRelayPolkadot.ts on lines 376..389

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

          return Object
            .keys(api.consts)
            .filter((s) => !s.startsWith('$'))
            .sort()
            .filter((name): number => Object.keys(api.consts[name]).length)
        Severity: Major
        Found in packages/react-components/src/InputConsts/options/section.ts and 3 other locations - About 35 mins to fix
        packages/react-components/src/InputCalls/options/method.tsx on lines 20..24
        packages/react-components/src/InputRpc/options/section.ts on lines 8..12
        packages/react-components/src/InputStorage/options/section.ts on lines 8..12

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

          const _onNameChange = useCallback(
            (name: string) => setName({ isNameValid: !!name.trim(), name }),
            []
          );
        Severity: Minor
        Found in packages/page-accounts/src/modals/Qr.tsx and 2 other locations - About 35 mins to fix
        packages/page-accounts/src/modals/Ledger.tsx on lines 78..81
        packages/page-addresses/src/modals/Create.tsx on lines 79..82

        Duplicated Code

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

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

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

        Tuning

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

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

          const existingCloseBountyProposal = useMemo(
            () => proposals?.find(({ proposal }) =>
              proposal && proposal.method === 'closeBounty'
            ),
            [proposals]
        Severity: Minor
        Found in packages/page-bounties/src/BountyExtraActions/index.tsx and 1 other location - About 35 mins to fix
        packages/page-bounties/src/BountyExtraActions/index.tsx on lines 60..65

        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

        Severity
        Category
        Status
        Source
        Language