Showing 173 of 2,513 total issues
Function generateForMeta
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void {
Function generateDefaultConsts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function generateDefaultConsts (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
Function generateDefaultEvents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function generateDefaultEvents (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
Function exportInterface
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function exportInterface (lookupIndex = -1, name = '', base: string, body = '', withShortcut = false): string {
Function getStashInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getStashInfo (api: DeriveApi, stashIds: AccountId[], activeEra: EraIndex, { withClaimedRewardsEras, withController, withDestination, withExposure, withExposureErasStakersLegacy, withExposureMeta, withLedger, withNominations, withPrefs }: StakingQueryFlags, page: u32 | AnyNumber): Observable<[(Option<AccountId> | null)[], Option<PalletStakingNominations>[], Option<PalletStakingRewardDestination>[], PalletStakingValidatorPrefs[], Option<SpStakingExposurePage>[], Option<SpStakingPagedExposureMetadata>[], number[][], SpStakingExposure[]]> {
Function generateDefaultRuntime
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function generateDefaultRuntime (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
Function tsEnum
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex, name: enumName, sub }: TypeDef, imports: TypeImports, withShortcut = false): string {
Function generateDefaultQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function generateDefaultQuery (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
Function generateDefaultTx
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function generateDefaultTx (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
Function decodeU8aVec
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, result: unknown[], u8a: Uint8Array, startAt: number, Type: CodecClass<T>): [number, number] {
Function createSubmittable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function createSubmittable<ApiType extends ApiTypes> (apiType: ApiTypes, api: ApiInterfaceRx, decorateMethod: ApiBase<ApiType>['_decorateMethod'], registry?: Registry, blockHash?: Uint8Array): Creator<ApiType> {
Function getBatch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getBatch (api: DeriveApi, activeEra: EraIndex, stashIds: AccountId[], flags: StakingQueryFlags, page: u32 | AnyNumber): Observable<DeriveStakingQuery[]> {
Function tsInt
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function tsInt (_: Registry, definitions: Record<string, ModuleTypes>, def: TypeDef, imports: TypeImports, type: 'Int' | 'UInt' = 'Int'): string {
Function convertCalls
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function convertCalls (specs: TypeSpec[], registry: Registry, modName: Text, calls: FunctionMetadataV13[], sectionTypes: OverrideModuleType): PalletCallMetadataV14 {
Function convertErrors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function convertErrors (specs: TypeSpec[], registry: Registry, modName: Text, errors: ErrorMetadataV13[], _sectionTypes: OverrideModuleType): PalletErrorMetadataV14 {
Function convertEvents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function convertEvents (specs: TypeSpec[], registry: Registry, modName: Text, events: EventMetadataV13[], sectionTypes: OverrideModuleType): PalletEventMetadataV14 {
Function createCallFunction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function createCallFunction (registry: Registry, lookup: PortableRegistry, variant: SiVariant, sectionName: string, sectionIndex: number): CallFunction {
Function compareRationals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function compareRationals (n1: BN, d1: BN, n2: BN, d2: BN): boolean {
while (true) {
const q1 = n1.div(d1);
const q2 = n2.div(d2);
- Read upRead up
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 inspectType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function inspectType (type: string): void {
try {
// get the definition
const { sub } = getTypeDef(registry.createType(type).toRawType());
- Read upRead up
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 findClosing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function findClosing (value: string, start: number): number {
let depth = 0;
for (let i = start, count = value.length; i < count; i++) {
if (value[i] === '>') {
- Read upRead up
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"