Showing 502 of 8,855 total issues
Function UsersTable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function UsersTable() {
const apps = useStoreState((state) => state.apps);
const ownerAccess = useStoreState((state) => state.user.ACL.ownerAccess);
const user = useStoreState((state) => state.user);
const [showNewUser, setShowNewUser] = React.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 UploadDocument
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const UploadDocument: React.FC<IUploadDocument> = ({}) => {
const [loading, setLoading] = useState(false);
const fileRef = useRef<HTMLInputElement>(null);
const { showSnackbar } = useSnackbar();
const [uploadedFile, setUploadedFile] = useState({
- 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 render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {currentMessage, nextMessage, position, containerStyle} = this.props;
if (currentMessage) {
const sameUser = isSameUser(currentMessage, nextMessage);
return (
- 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 NftTransactionItem
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const NftTransactionItem: React.FC<TransactionListProps> = ({
transactionReceiver,
transactionSender,
transactionAmount,
showDate,
- 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 NftItemHistoryScreen
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const NftItemHistoryScreen = (props: any) => {
const {item, userWalletAddress} = props.route.params.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 router
has 43 lines of code (exceeds 25 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);
- Create a ticketCreate a ticket
Function ChangeBackground
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChangeBackground: React.FC<IChangeBackground> = ({}) => {
const { roomJID } = useParams<{ roomJID: string }>();
const [selectedIndex, setSelectedIndex] = useState(0);
const {showSnackbar} = useSnackbar()
const currentRoom = useStoreState((state) =>
- Create a ticketCreate a ticket
Function sendMessage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sendMessage = (button: any) => {
if (myMessage.trim().length > 0) {
let userAvatar = "";
if (profile?.profileImage) {
userAvatar = profile?.profileImage;
- Create a ticketCreate a ticket
Function registerUser
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const registerUser = async () => {
const body = regularLoginEmail
? {
firstName: firstname,
lastName: lastname,
- Create a ticketCreate a ticket
Function replyComponent
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const replyComponent = () => {
return currentMessage.isReply ? (
<TouchableOpacity onPress={() => scrollToParentMessage(currentMessage)}>
<HStack
style={styles[position].replyWrapper}
- Create a ticketCreate a ticket
Function InviteFriendsScreen
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const InviteFriendsScreen = observer(({}) => {
const [index, setIndex] = useState(0);
const layout = useWindowDimensions();
const {loginStore} = useStores();
- Create a ticketCreate a ticket
Function sendAttachment
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sendAttachment = async () => {
try {
const res = await DocumentPicker.pick({
type: [DocumentPicker.types.allFiles],
copyTo: 'cachesDirectory',
- Create a ticketCreate a ticket
Function DeletAppModal
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function DeletAppModal(props: TProps) {
const [loading, setLoading] = React.useState(false)
const deleteApp = useStoreState(state => state.deleteApp)
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
- Create a ticketCreate a ticket
Function RotateModal
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function RotateModal(props: TProps) {
const [loading, setLoading] = React.useState(false)
const updateApp = useStoreState(state => state.updateApp)
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
!process.env.TYPE ||
!process.env.BOT_ADDRESS ||
!process.env.CONFERENCE_ADDRESS ||
!process.env.APP_USERNAME ||
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
!process.env.TYPE ||
!process.env.BOT_ADDRESS ||
!process.env.CONFERENCE_ADDRESS ||
!process.env.APP_USERNAME ||
- Create a ticketCreate a ticket
Function router
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const router = (xmpp, message, sender, receiver, requestType, receiverData, stanzaId, connectData) => {
if (requestType === 'body') {
let userStep = userSteps('getStep', receiver, null);
let handlerData = {
- Create a ticketCreate a ticket
Function addAudioElement
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addAudioElement = (blob: Blob) => {
setLoading(true);
let formData = new FormData();
formData.append("files", blob);
uploadFile(formData)
- Create a ticketCreate a ticket
Function questionHandler
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const questionHandler = (data) => {
getListQuestions().then(result => {
let questions = result;
getListAnswers(data.receiver).then(result => {
if(questions.length === result.length){
- Create a ticketCreate a ticket
Function generateValueWithAddedSuggestion
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const generateValueWithAddedSuggestion = (
parts: Part[],
mentionType: MentionPartType,
plainText: string,
selection: Position,
- Create a ticketCreate a ticket