dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function RenderMainMessageSection has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const RenderMainMessageSection: React.FC = () => {
    const firstName = currentThreadMessage?.user.name.split(' ')[0] || 'N/A';
    const lastName = currentThreadMessage?.user.name.split(' ')[1] || 'N/A';
    //@ts-ignore
    const parentDate = new Date(currentThreadMessage?.createdAt * 1000);
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 2 hrs to fix

Function RenderCoin has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RenderCoin = (props: RenderCoinProps) => {
  const {tokenSymbol, tokenName, balance, index} = props;
  return (
    <View
      style={{
Severity: Major
Found in client-reactnative/src/components/Transactions/RenderCoin.tsx - About 2 hrs to fix

Function ThreadContainer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const ThreadContainer: React.FC<ThreadContainerProps> = ({
  roomData,
  handleSetThreadView,
  isThreadView,
  profile,
Severity: Minor
Found in client-web/src/components/Chat/Threads/ThreadContainer.tsx - About 2 hrs 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 EditProfileModal has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export default function EditProfileModal({ open, setOpen, user }: TProps) {
  const [change, setChange] = useState(false);
  const [loading, setLoading] = useState(false);
  const setUser = useStoreState((state) => state.setUser);

Severity: Minor
Found in client-web/src/pages/Profile/EditProfileModal.tsx - About 2 hrs 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 RegisterScreen has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const RegisterScreen = ({navigation}: RegisterScreenProps) => {
  const [password, setPassword] = useState('');
  const [username, setUsername] = useState('');
  const [passwordCheck, setPasswordCheck] = useState('');
  const [firstname, setFirstname] = useState('');
Severity: Minor
Found in client-reactnative/src/Screens/Login/RegisterScreen.tsx - About 2 hrs 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 handleSendMessage has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const handleSendMessage = (message: IMessage[]) => {
    const messageText = message[0].text;
    const tokenAmount = message[0].tokenAmount || 0;
    const receiverMessageId = message[0].receiverMessageId || 0;
    const data = {
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 2 hrs to fix

Function router has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const router = (handlerData) => {
    const roomMuteIndex = muteRoomList.indexOf(handlerData.roomJID)

    if(roomMuteIndex > -1){
        if (messageCheck(handlerData.message, 'start translate') ||
Severity: Major
Found in bots/translateBot/router.js - About 2 hrs to fix

Function router has 51 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: Major
Found in bots/autoResponder/router.js - About 2 hrs to fix

Function QRSection has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const QRSection = (props: QRSectionProps) => {
    const {
        user,
        createdLink,
        linkType
Severity: Major
Found in client-web/src/pages/Privacy/QRSection.tsx - About 2 hrs to fix

Function setChatAvatar has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const setChatAvatar = async (type: string) => {
    if (type === 'image') {
      launchImageLibrary(options, response => {
        if (response.didCancel) {
          console.log('User cancelled image picker');
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx - About 2 hrs 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/translateBot/config/connect.js - About 2 hrs 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/raffle/config/connect.js - About 2 hrs 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/botTemplate/config/connect.js - About 2 hrs to fix

Function Explorer has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function Explorer() {
  const user = useStoreState((store) => store.user);
  const [transactions, setTransactions] = useState<
    ExplorerRespose<ITransaction[]>
  >({
Severity: Minor
Found in client-web/src/pages/Explorer/Explorer.tsx - About 2 hrs to fix

Function setChatAvatar has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const setChatAvatar = async (type: string) => {
    if (type === 'image') {
      launchImageLibrary(options, response => {
        if (response.didCancel) {
          console.log('User cancelled image picker');
Severity: Minor
Found in client-reactnative/src/Screens/MintScreen.tsx - About 2 hrs to fix

Function onSuccess has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onSuccess = (e: any) => {
    if (!e) {
      showToast('error', 'Error', 'Invalid QR', 'top');
      setIsLoading(false);
      return;
Severity: Minor
Found in client-reactnative/src/Screens/Actions/ScanScreen.tsx - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

    if (
      item.tokenType === 'NFMT' &&
      item.balances &&
      item.contractTokenIds &&
      item.maxSupplies &&
Severity: Critical
Found in client-reactnative/src/stores/walletStore.ts - About 2 hrs to fix

Function OtherItemsTable has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function OtherItemsTable(props: TProps) {
  const [balances, setBalances] = React.useState<TBalances>([]);
  React.useEffect(() => {
    if (props.walletAddress) {
      http.getPublicProfile(props.walletAddress).then((response) => {
Severity: Minor
Found in client-web/src/pages/Profile/OtherItemsTable.tsx - About 1 hr to fix

Function LinkItemComponent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function LinkItemComponent(props: ProfileLinkItemComponentProps) {
  const { linkItem, key, handleOpenModal, profileLink, deleteLink } = props;
  return (
    <Box
      key={key}
Severity: Minor
Found in client-web/src/pages/Privacy/ManageProfileTabPanel.tsx - About 1 hr to fix

Function LinkItemComponent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function LinkItemComponent(props: DocumentLinkItemComponentProps) {
  const { linkItem, key, handleOpenModal, docLink, deleteLink } = props;
  return (
    <Box
      key={key}
Severity: Minor
Found in client-web/src/pages/Privacy/ManageDocumentShareTabPanel.tsx - About 1 hr to fix
Severity
Category
Status
Source
Language