dappros/ethora

View on GitHub

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);
Severity: Minor
Found in client-web/src/pages/Owner/Users.tsx - About 1 hr to fix

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({
Severity: Minor
Found in client-web/src/pages/UploadDocument/UploadDocument.tsx - About 1 hr to fix

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 (
Severity: Minor
Found in client-reactnative/src/components/Chat/MessageBody.tsx - About 1 hr to fix

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,

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();

Severity: Minor
Found in client-reactnative/src/Screens/Profile/NftItemHistoryScreen.tsx - About 1 hr to fix

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);
Severity: Minor
Found in bots/gptBot/router.js - About 1 hr to fix

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) =>
Severity: Minor
Found in client-web/src/pages/ChatRoomDetails/ChangeBackground.tsx - About 1 hr to fix

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;
Severity: Minor
Found in client-web/src/pages/ChatInRoom/Chat.tsx - About 1 hr to fix

Function registerUser has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const registerUser = async () => {
    const body = regularLoginEmail
      ? {
          firstName: firstname,
          lastName: lastname,
Severity: Minor
Found in client-reactnative/src/Screens/Login/RegisterScreen.tsx - About 1 hr to fix

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}
Severity: Minor
Found in client-reactnative/src/components/Chat/MessageBubble.tsx - About 1 hr to fix

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();
Severity: Minor
Found in client-reactnative/src/Screens/Account/InviteFriendsScreen.tsx - About 1 hr to fix

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',
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 1 hr to fix

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'));
Severity: Minor
Found in client-web/src/pages/Owner/DeletAppModal.tsx - About 1 hr to fix

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'));
Severity: Minor
Found in client-web/src/pages/Owner/RotateModal.tsx - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

    if (
        !process.env.TYPE ||
        !process.env.BOT_ADDRESS ||
        !process.env.CONFERENCE_ADDRESS ||
        !process.env.APP_USERNAME ||
Severity: Critical
Found in bots/gptBot/config/connect.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

    if (
        !process.env.TYPE ||
        !process.env.BOT_ADDRESS ||
        !process.env.CONFERENCE_ADDRESS ||
        !process.env.APP_USERNAME ||
Severity: Critical
Found in bots/autoResponder/config/connect.js - About 1 hr to fix

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 = {
Severity: Minor
Found in bots/questionnaire/router.js - About 1 hr to fix

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)
Severity: Minor
Found in client-web/src/components/Chat/ChatAudioRecorder.tsx - About 1 hr to fix

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){
Severity: Minor
Found in bots/questionnaire/handlers/question.js - About 1 hr to fix

Function generateValueWithAddedSuggestion has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const generateValueWithAddedSuggestion = (
  parts: Part[],
  mentionType: MentionPartType,
  plainText: string,
  selection: Position,
Severity: Minor
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 1 hr to fix
Severity
Category
Status
Source
Language