Showing 502 of 8,855 total issues
Function EmailListItem
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmailListItem = (props: EmailListItemProps) => {
const {emailList, tooltipVisible, setTooltipVisible, deleteEmail} = props;
const {email, verified} = emailList.item;
const index = emailList.index;
- Create a ticketCreate a ticket
Function RoomList
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const RoomList:React.FC<IRoomList> = observer((props:IRoomList) => {
const {chatStore} = useStores();
const {roomsList} = props;
const sortedRoomsList = roomsList.sort(
(a: any, b: any) =>
- Create a ticketCreate a ticket
Function router
has a Cognitive Complexity of 12 (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 Routes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const Routes = () => {
const userId = useStoreState((state) => state.user._id);
const user = useStoreState((state) => state.user);
const setACL = useStoreState((state) => state.setACL);
- 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 MainHeader
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const MainHeader = observer(() => {
const {chatStore, apiStore, loginStore} = useStores();
const navigation = useNavigation<HomeStackNavigationProp>();
const route = useRoute();
const buttons = [
- 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 ChatDetailHeader
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const ChatDetailHeader: React.FunctionComponent<ChatDetailHeaderProps> = (
props: ChatDetailHeaderProps,
) => {
//component props
const {deleteRoomDialog, toggleFavourite, currentRoomDetail} = props;
- 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 NewChatScreen
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const NewChatScreen = (props: NewChatScreenProps) => {
const [chatAvatar, setChatAvatar] = useState();
const [chatName, setChatName] = useState('');
const [chatDescription, setChatDescription] = useState('');
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 messages
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const messages = () => {
return {
general: {
welcomeMessage: 'Hey! Hut Hut Bot launched',
botStatusOnline: 'Hut hut Online',
- Create a ticketCreate a ticket
Function BlackListUserItem
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BlackListUserItem(props: BlackListUserItemProps) {
const { userItem, handleRemove } = props;
return (
<Box
- Create a ticketCreate a ticket
Function sendAttachment
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sendAttachment = async (
userToken: string,
roomDetail: roomListProps,
) => {
const xmpp = chatStore.xmpp;
- Create a ticketCreate a ticket
Function handleFaceBookLogin
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const handleFaceBookLogin = async (
defaultToken: string,
loginUser: any,
registerSocialUser: any,
type: string,
- Create a ticketCreate a ticket
Function TransactionAddressDetails
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TransactionAddressDetails: React.FC<ITransactionAddressDetailsProps> = (
props
) => {
const [transactions, setTransactions] = useState<
ExplorerRespose<ITransaction[]>
- Create a ticketCreate a ticket
Function produceNfmtItems
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const produceNfmtItems = (array: any[]) => {
const result = [];
const rareTotal = 20;
const uniqueTotal = 1;
- Create a ticketCreate a ticket
Function onMintClick
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onMintClick = () => {
if (!nftFileUrl) {
showError('Error', 'Please load the image.');
return;
}
- Create a ticketCreate a ticket
Function ChatBackgroundCard
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChatBackgroundCard = (props: ChatBackgroundCardProps) => {
return (
<Pressable
justifyContent={'center'}
alignItems={'center'}
- Create a ticketCreate a ticket
Function transferItems
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const transferItems = async () => {
if (!selectedItem?.balance) {
showError('error', 'Not enough tokens');
}
const receiverName = dataForTransfer.name;
- Create a ticketCreate a ticket
Function deleteEmailFromList
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async deleteEmailFromList(token: any, email: any) {
const url = addOrDeleteEmail + '/' + email;
runInAction(() => {
this.isFetching = true;
- Create a ticketCreate a ticket
Function renderItems
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderItems = () => {
const getItemSelected = (pressedItem: TSelectedItem, item:any) => {
if (item.tokenType === 'NFMT') {
return (
pressedItem.nfmtType + pressedItem.contractAddress ===
- Create a ticketCreate a ticket
Function handleLongTapMenu
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleLongTapMenu = (type: number) => {
if (type === 0) {
if (longTapUser.ban_status === 'clear') {
banUserr(
manipulatedWalletAddress,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
data.botName &&
data.botAddress &&
data.botPassword &&
data.conferenceAddress &&
- Create a ticketCreate a ticket