polkadot-js/apps

View on GitHub

Showing 2,041 of 2,041 total issues

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

function applyFilter (validators: ValidatorInfo[], medianComm: number, allIdentity: Record<string, DeriveHasIdentity>, { daysPayout, isBabe, maxPaid, withElected, withGroup, withIdentity, withPayout, withoutComm, withoutOver }: Flags, nominatedBy?: NominatedByMap): ValidatorInfo[] {
Severity: Minor
Found in packages/page-staking/src/Targets/index.tsx - About 35 mins to fix

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

    function createResult (bestNumber: BlockNumber, minContribution: BN, funds: Campaign[], leased: ParaId[], prev: Campaigns): Campaigns {
    Severity: Minor
    Found in packages/page-parachains/src/useFunds.ts - About 35 mins to fix

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

      export function getTrackInfo (api: ApiPromise, specName: string, palletReferenda: string, tracks: TrackDescription[], trackId?: number): TrackInfoExt | undefined {
      Severity: Minor
      Found in packages/page-referenda/src/util.ts - About 35 mins to fix

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

        function getChartResult (totalEligible: BN, isConvictionVote: boolean, info: PalletReferendaReferendumInfoConvictionVotingTally | PalletReferendaReferendumInfoRankedCollectiveTally, track: PalletReferendaTrackInfo, trackGraph: CurveGraph): ChartResultExt[] | null {
        Severity: Minor
        Found in packages/page-referenda/src/Referenda/Referendum.tsx - About 35 mins to fix

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

          function mergeCurrent (ranges: [number, number][], auctionInfo: AuctionInfo, prev: Winning[] | undefined, optCurrent: Option<WinningData>, blockOffset: BN): Winning[] | undefined {
          Severity: Minor
          Found in packages/page-parachains/src/useWinningData.ts - About 35 mins to fix

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

            function getStatus (api: ApiPromise, bestNumber: BlockNumber, votes: Votes, numMembers: number, section: CollectiveType): State {
            Severity: Minor
            Found in packages/react-hooks/src/useVotingStatus.ts - About 35 mins to fix

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

              function checkVisible ({ api, isApiConnected, isApiReady, isDevelopment: isApiDevelopment }: ApiProps, allowTeleport: boolean, hasAccounts: boolean, hasSudo: boolean, { isDevelopment, isHidden, needsAccounts, needsApi, needsApiCheck, needsApiInstances, needsSudo, needsTeleport }: Route['display']): boolean {
              Severity: Minor
              Found in packages/apps/src/Menu/index.tsx - About 35 mins to fix

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

                async function extractParams (api: ApiPromise, address: string, options: Partial<SignerOptions>, getLedger: () => Ledger, setQrState: (state: QrState) => void): Promise<['qr' | 'signing', string, Partial<SignerOptions>, boolean]> {
                Severity: Minor
                Found in packages/react-signer/src/TxSigned.tsx - About 35 mins to fix

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

                  function fitsInView (positionY: VerticalPosition, trigger: ElementPosition, popupWindowHeight: number, windowSize: WindowSize, scrollY: number): boolean {
                  Severity: Minor
                  Found in packages/react-components/src/Popup/utils.ts - 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

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

                        function createHdr (bn: string, hash: string, parent: string, author: string | null, isEmpty = false): LinkHeader {
                        Severity: Minor
                        Found in packages/page-explorer/src/Forks.tsx - About 35 mins to fix

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

                          export function checkVisibility (api: ApiPromise, address: string, accountInfo: DeriveAccountInfo, filterName = '', onlyNamed = false): boolean {
                          Severity: Minor
                          Found in packages/react-components/src/util/checkVisibility.tsx - About 35 mins to fix

                            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

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

                                return Object
                                  .keys(api.rpc)
                                  .filter((s) => !s.startsWith('$'))
                                  .sort()
                                  .filter((section) => Object.keys((api.rpc as unknown as Record<string, Record<string, unknown>>)[section]).length !== 0)
                              Severity: Major
                              Found in packages/react-components/src/InputRpc/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/InputConsts/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 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 4 locations. Consider refactoring.
                              Open

                                return Object
                                  .keys(api.query)
                                  .filter((s) => !s.startsWith('$'))
                                  .sort()
                                  .filter((n) => Object.keys(api.query[n]).length)
                              Severity: Major
                              Found in packages/react-components/src/InputStorage/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/InputConsts/options/section.ts on lines 8..12
                              packages/react-components/src/InputRpc/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

                              Severity
                              Category
                              Status
                              Source
                              Language