Showing 502 of 8,855 total issues
Function Signon
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function Signon() {
const setUser = useStoreState((state) => state.setUser);
const user = useStoreState((state) => state.user);
const query = useQuery();
const history = useHistory();
- Read upRead up
- Create a ticketCreate a ticket
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 getPartsInterval
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const getPartsInterval = (
parts: Part[],
cursor: number,
count: number,
): Part[] => {
- Read upRead up
- Create a ticketCreate a ticket
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 getPushToken
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getPushToken = async (
walletAddress: string,
DOMAIN: string,
defaultUrl: string,
navigation: HomeStackNavigationProp,
- Read upRead up
- Create a ticketCreate a ticket
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 transferTokens
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async transferTokens(
bodyData: any,
token: string,
fromWallet: string,
senderName: string,
- Read upRead up
- Create a ticketCreate a ticket
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 mapTransactions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const mapTransactions = (item: any, walletAddress: string) => {
if (item.tokenId === 'NFT') {
if (item.from === walletAddress && item.from !== item.to) {
item.balance = item.senderBalance + '/' + item.nftTotal;
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 DocumentShareManage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const DocumentShareManage: React.FC<IDocumentShareManage> = ({
onAddPress,
}) => {
const [sharedLinks, setSharedLinks] = useState<ISharedLink[]>([]);
const {loginStore} = useStores();
- Read upRead up
- Create a ticketCreate a ticket
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 ProfileShareManage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const ProfileShareManage: React.FC<IProfileShareManage> = ({
onAddPress,
}) => {
const [sharedLinks, setSharedLinks] = useState<ISharedLink[]>([]);
const {loginStore, apiStore} = useStores();
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if (
currentSavedChatRoom.length > 0 &&
currentSavedChatRoom[0].toUpdate
) {
useStoreState.getState().updateUserChatRoom(roomData);
- Create a ticketCreate a ticket
Function router
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const router = (handlerData) => {
handlerData.userStep = userSteps('getStep', handlerData.userJID);
if (messageCheck(handlerData.message, 'close') || messageCheck(handlerData.message, 'leave')) {
return leaveHandler(handlerData);
- Read upRead up
- Create a ticketCreate a ticket
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 EditAcl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const EditAcl: React.FC<IEditAcl> = ({ userId, updateData }) => {
const [userAcl, setUserAcl] = useState<IUserAcl>();
const [userAclApplicationKeys, setUserAclApplicationKeys] = useState<
Array<TKeys>
>([]);
- Read upRead up
- Create a ticketCreate a ticket
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 produceNfmtItems
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const produceNfmtItems = (array = []) => {
const result = [];
const rareTotal = 20;
const uniqueTotal = 1;
- Read upRead up
- Create a ticketCreate a ticket
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 Row
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Row = ({
name,
row,
onChange,
disableAllRow,
- Read upRead up
- Create a ticketCreate a ticket
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 getPosition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getPosition = (
arr: TMessageHistory[],
message: TMessageHistory,
index: number
) => {
- Read upRead up
- Create a ticketCreate a ticket
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 OtherProfile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function OtherProfile(props: TProps) {
const [loading, setLoading] = useState(true);
const [profile, setProfile] = useState<TProfile>();
const [transactions, setTransactions] =
useState<ExplorerRespose<ITransaction[]>>();
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if (isValid) {
// next question
participant.answers[currentQuestion.name] = participant.msg
await nextMessage(
participant,
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (START_BOT_COMMANDS.includes(msgText.toLocaleLowerCase())) {
const data = stanza.getChild("data");
if (data) {
const newParticipant: Participant = {
- Create a ticketCreate a ticket
Function repeatMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
participant: Participant,
questions: Question[],
participants: { [key: string]: Participant },
onEnd: (p: Participant, client: Client, walletAddress: string) => Promise<void>,
client: Client,
- Create a ticketCreate a ticket
Function nextMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
participant: Participant,
questions: Question[],
participants: { [key: string]: Participant },
onEnd: (p: Participant, client: Client, walletAddress: string) => Promise<void>,
client: Client,
- Create a ticketCreate a ticket
Function nextMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
participant: Participant,
questions: Question[],
participants: { [key: string]: Participant },
onEnd: (p: Participant, client: Client, walletAddress: string) => Promise<void>,
client: Client,
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (isValid) {
// next question
participant.answers[currentQuestion.name] = participant.msg;
await nextMessage(
participant,
- Create a ticketCreate a ticket