Showing 609 of 2,082 total issues
Function Collection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function Collection ({ className, value: { details, id, ipfsData } }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const name = ipfsData?.name || '';
let imageLink = '';
- 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 InputExtrinsic
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function InputExtrinsic ({ className = '', defaultValue, filter, isDisabled, label, onChange, withLabel }: Props): React.ReactElement<Props> {
const { api } = useApi();
const [optionsMethod, setOptionsMethod] = useState<DropdownOptions>(() => methodOptions(api, defaultValue.section, filter));
const [optionsSection] = useState<DropdownOptions>(() => sectionOptions(api, filter));
const [value, setValue] = useState<SubmittableExtrinsicFunction<'promise'>>((): SubmittableExtrinsicFunction<'promise'> => defaultValue);
- 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 renderItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function renderItem ({ error, extrinsic, id, removeItem, rpc, status }: QueueTx): React.ReactNode {
let { method, section } = rpc;
if (extrinsic) {
const found = extrinsic.registry.findMetaCall(extrinsic.callIndex);
- 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 AddressToggle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function AddressToggle ({ address, className = '', filter, isHidden, noToggle, onChange, value }: Props): React.ReactElement<Props> | null {
const { apiIdentity } = useApi();
const info = useDeriveAccountInfo(address);
const isVisible = useMemo(
- 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 SettingsApp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function SettingsApp ({ basePath, onStatusChange }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api, isApiConnected, isApiReady, isDevelopment } = useApi();
const numExtensions = useCounter();
- 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 AddressMini
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function AddressMini ({ balance, bonded, children, className = '', iconInfo, isHighlight, isPadded = true, label, labelBalance, nameExtra, onNameClick, summary, value, withAddress = true, withBalance = false, withBonded = false, withLockedVote = false, withName = true, withShrink = false, withSidebar = true }: Props): React.ReactElement<Props> | null {
if (!value) {
return null;
}
- 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
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return (
<Banner type='warning'>
<p>{t('It is recommended that you create/store your accounts securely and externally from the app. On {{yourBrowser}} the following browser extensions are available for use -', {
replace: {
yourBrowser: stringUpperFirst(browserName)
Avoid too many return
statements within this function. Open
return { error: (error as Error).message };
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return isAscii(value)
? [true, false, stringToU8a(value)]
: [value === '0x', false, new Uint8Array([])];
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return Component || Unknown;
Avoid too many return
statements within this function. Open
return BN_ZERO;
Avoid too many return
statements within this function. Open
return '0x';
Avoid too many return
statements within this function. Open
return bnMin(
BN_BILLION,
factor
.mul(BN_BILLION)
.div(div)
Avoid too many return
statements within this function. Open
return bnMin(
BN_BILLION,
bnMax(
BN_ZERO,
factor
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return true;