Showing 502 of 8,855 total issues
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
Avoid deeply nested control flow statements. Open
if (
this.blackList.find(item => item.userJid === message.user._id)
?.userJid
) {
return;
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (message.isReply && message.mainMessage?.id) {
const thread = temporaryArchiveMessages.filter(
item => item.mainMessage?.id === message.mainMessage?.id,
);
this.updateMessageProperty(
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (message.system) {
if (message?.contractAddress && message.nftId) {
await updateMessageToWrapped(message.receiverMessageId, {
nftId: message.nftId,
contractAddress: message.contractAddress,
- Create a ticketCreate a ticket
Function NftListItem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const NftListItem = (props: NftListItemProps) => {
const {
assetUrl,
assetsYouHave,
totalAssets,
- 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 EnterInviteCode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const EnterInviteCode = observer(() => {
const [code, setCode] = useState('');
const [loading, setLoading] = useState(false);
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
Function ManageData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const ManageData: React.FC<IManageData> = ({}) => {
const {loginStore} = useStores();
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const [loading, setLoading] = useState(false);
- 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 EnterInviteCode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const EnterInviteCode = observer(() => {
const [code, setCode] = useState('');
const [loading, setLoading] = useState(false);
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
Consider simplifying this complex logical expression. Open
if (
!firstname ||
!lastname ||
!username ||
!password ||
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
currentMessage &&
nextMessage &&
position &&
isSameUser(currentMessage, nextMessage) &&
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
currentMessage &&
previousMessage &&
position &&
isSameUser(currentMessage, previousMessage) &&
- Create a ticketCreate a ticket
Function getTnc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
company: string,
fname: string,
lname: string,
email: string,
date: string
- Create a ticketCreate a ticket
Function sendMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export async function sendMessage(p: Participant, message: Message, client: Client, walletAddress: string, repeat = false): Promise<void> {
- Create a ticketCreate a ticket
Function registerOwner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
firstName: string,
lastName: string,
email: string,
company: string,
tnc: string
- Create a ticketCreate a ticket
Function sendMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export async function sendMessage(p: Participant, message: Message, client: Client, walletAddress: string, repeat = false): Promise<void> {
- Create a ticketCreate a ticket
Function registerSignature
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
walletAddress: string,
signature: string,
msg: string,
firstName: string,
lastName: string
- Create a ticketCreate a ticket
Function sendMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const sendMessage = (data, message, type, isSystemMessage, tokenAmount) => {
data.xmpp.send(xml('message', {
to: data.stanzaId ? data.stanzaId.attrs.by : data.receiver,
type: data.receiverData ? 'groupchat' : type,
id: "sendMessage"
- 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 userSteps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const userSteps = (type, jid, step, newData) => {
//Get the index of the user in the array by his jid
const userIndex = userStepsList.findIndex(user => user.name === jid);
//If the user with the specified jid is not found, create a new data object for him.
- 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 sendMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const sendMessage = (data, message, type, isSystemMessage, tokenAmount) => {
data.xmpp.send(xml('message', {
to: data.stanzaId ? data.stanzaId.attrs.by : data.receiver,
type: data.receiverData ? 'groupchat' : type,
id: "sendMessage"
- 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"