Showing 600 of 2,052 total issues
Avoid too many return
statements within this function. Open
return {
action: `${section}.${method}`,
message: EVENT_MESSAGE,
status: 'event'
};
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return t('Sign (no submission)');
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return ['signing', address, { ...options, signer: new AccountSigner(api.registry, pair) }, false];
Avoid too many return
statements within this function. Open
return findMissingApis(api, needsApi, needsApiInstances, needsApiCheck).length === 0;
Avoid too many return
statements within this function. Open
return (value as string).toString();
Avoid too many return
statements within this function. Open
return `{${[...value.entries()]
.map(([k, v]) => `${(k as string).toString()}: ${format(v)}`)
.join(', ')}}`;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return <div>{item.value.toString().split(',').join(', ')}</div>;
Function tattoo3
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function tattoo3 (ctx: CanvasRenderingContext2D, bits: boolean[]): void {
ctx.lineWidth = 0.01;
for (let i = 0; i < 8; ++i) {
for (let j = 0; j < 32; ++j) {
- 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 Nominate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function Nominate ({ className = '', controllerId, nominating, onChange, poolId, stashId, targets: { nominateIds = [] }, withSenders }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const [favorites] = useFavorites(STORE_FAVS_BASE);
const [selected, setSelected] = useState<string[]>(nominating || []);
- 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 Rebag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function Rebag ({ bagUpper, stashIds }: Props): React.ReactElement<Props> | null {
const { t } = useTranslation();
const { api } = useApi();
const [accountId, setAccountId] = useState<string | null>(null);
const [isVisible, toggleVisible] = useToggle();
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
transform: ([[ids], opts]: [[string[]], Option<PalletNominationPoolsPoolMember>[]]): OwnPoolBase[] => {
const pools: OwnPoolBase[] = [];
for (let i = 0; i < ids.length; i++) {
if (opts[i].isSome) {
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function execute (extrinsic: SubmittableExtrinsic<'promise'>, singer: KeyringPair, logger = { info: console.log }): Promise<void> {
let currentTxDone = false;
function sendStatusCb ({ events = [], status }: { events?: EventRecord[], status: ExtrinsicStatus; }) {
if (status.isInvalid) {
- 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 NewValidator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function NewValidator ({ isInElection, minCommission, targets }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const [isVisible, toggleVisible] = useToggle();
const [{ bondTx, controllerId, controllerTx, stashId }, setBondInfo] = useState<BondInfo>({});
- 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 extractBaseInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function extractBaseInfo (api: ApiPromise, allAccounts: string[], electedDerive: DeriveStakingElected, waitingDerive: DeriveStakingWaiting, favorites: string[], totalIssuance: BN, lastEraInfo: LastEra, historyDepth?: BN): Partial<SortedTargets> {
const [elected, nominators] = extractSingle(api, allAccounts, electedDerive, favorites, lastEraInfo, historyDepth, true);
const [waiting] = extractSingle(api, allAccounts, waitingDerive, favorites, lastEraInfo);
const activeTotals = elected
.filter(({ isActive }) => isActive)
- 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"