Showing 502 of 8,855 total issues
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 helloMessageHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const helloMessageHandler = (data) => {
console.log('=> helloMessageHandler || Message received from ', data.userJID, data.message);
userData('setData', data.userJID, '', 'deleteItem');
getUserData(data.userJID).then(userData => {
- 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 errorHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const errorHandler = (data) => {
console.log('=> errorHandler | Message received from ', data.receiver, data.message);
if (data.userStep === 2) {
if(data.receiverData.attrs.isSystemMessage){
return 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 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 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 EmailSingInForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function EmailSingInForm(props: TProps) {
const history = useHistory();
const setUser = useStoreState((state) => state.setUser);
const [disable, setDisable] = useState(false);
const [showPassword, setShowPassword] = 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 EmailSignUpForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function EmailSignUpForm(props: TProps) {
const [showPassword, setShowPassword] = useState(false);
const [openSnack, setOpenSnack] = useState(false);
const [errorMsg, setErrorMsg] = useState("");
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 UsernameSignInForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function UsernameSignInForm(props: TProps) {
const setUser = useStoreState((state) => state.setUser);
const history = useHistory();
const formik = useFormik({
initialValues: {
- 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 Referrals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Referrals: React.FC<IReferrals> = ({}) => {
const link = useStoreState((state) => state.user._id);
const walletAddress = useStoreState((state) => state.user.walletAddress);
const setBalance = useStoreState((state) => state.setBalance);
- 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 UsernameSignUpForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function UsernameSignUpForm(props: TProps) {
const history = useHistory();
const setUser = useStoreState((state) => state.setUser);
const [showPassword, setShowPassword] = 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 DocumentHistoryScreen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const DocumentHistoryScreen = ({route, navigation}: ScreenProps) => {
const {item, userWalletAddress} = route.params;
const {loginStore, walletStore} = 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 OtherUserProfileScreen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const OtherUserProfileScreen = observer(({route}: ScreenProps) => {
const {loginStore, walletStore, apiStore, chatStore, otherUserStore} =
useStores();
const navigation = useNavigation<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 TransactionsList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
({transactions, walletAddress, onEndReached}: TransactionListProps) => {
const [activeFilter, setActiveFilter] = useState(FILTERS.all);
const getFilteredTransactions = () => {
if (activeFilter === FILTERS.all) {
return transactions;
- 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 ProfileModal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ProfileModal = (props: ProfileModalProps) => {
const {
isVisible,
onBackdropPress,
modalType,
- 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 loginOrRegisterSocialUser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const loginOrRegisterSocialUser = async (
user: any,
defaultToken: string,
loginUser: any,
- 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 too many return
statements within this function. Open
return botInitiate(handlerData);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return sendMessage(
handlerData,
messages.visitingHut.tnxForTransaction,
'message',
false,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return leaveHandler(handlerData);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return helpHandler(handlerData);
- Create a ticketCreate a ticket