Showing 173 of 2,509 total issues
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 generateForMeta
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void {
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 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 exportInterface
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function exportInterface (lookupIndex = -1, name = '', base: string, body = '', withShortcut = false): string {
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 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 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 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 formatType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function formatType (registry: Registry, definitions: Record<string, ModuleTypes>, type: AnyString | TypeDef, imports: TypeImports, withShortcut = false): string {
Function generateTsDefFor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function generateTsDefFor (registry: Registry, importDefinitions: Record<string, Record<string, ModuleTypes>>, defName: string, { types }: { types: Record<string, any> }, outputDir: string): void {
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 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 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 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 convertCalls
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function convertCalls (specs: TypeSpec[], registry: Registry, modName: Text, calls: FunctionMetadataV13[], sectionTypes: OverrideModuleType): PalletCallMetadataV14 {
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"
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 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"