dappros/ethora

View on GitHub

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

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

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);
Severity: Minor
Found in bots/autoResponder/router.js - 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 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);
Severity: Minor
Found in client-web/src/pages/Routes.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 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 = [
Severity: Minor
Found in client-reactnative/src/components/MainHeader/MainHeader.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 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;

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);
Severity: Minor
Found in client-reactnative/src/Screens/Chat/NewChatScreen.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 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',
Severity: Minor
Found in bots/huthut/config/messages.js - About 1 hr to fix

Function BlackListUserItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function BlackListUserItem(props: BlackListUserItemProps) {
  const { userItem, handleRemove } = props;

  return (
    <Box
Severity: Minor
Found in client-web/src/pages/Privacy/Blocking.tsx - About 1 hr to fix

Function sendAttachment has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const sendAttachment = async (
    userToken: string,
    roomDetail: roomListProps,
  ) => {
    const xmpp = chatStore.xmpp;
Severity: Minor
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 1 hr to fix

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,
Severity: Minor
Found in client-reactnative/src/helpers/login/socialLoginHandle.ts - About 1 hr to fix

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[]>
Severity: Minor
Found in client-web/src/pages/Explorer/TransactionAddressDetails.tsx - About 1 hr to fix

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;

Severity: Minor
Found in client-reactnative/src/stores/walletStore.ts - About 1 hr to fix

Function onMintClick has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onMintClick = () => {
    if (!nftFileUrl) {
      showError('Error', 'Please load the image.');
      return;
    }
Severity: Minor
Found in client-reactnative/src/Screens/Actions/MintScreen.tsx - About 1 hr to fix

Function ChatBackgroundCard has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ChatBackgroundCard = (props: ChatBackgroundCardProps) => {
  return (
    <Pressable
      justifyContent={'center'}
      alignItems={'center'}
Severity: Minor
Found in client-reactnative/src/components/Chat/ChatBackgroundCard.tsx - About 1 hr to fix

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;

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;
Severity: Minor
Found in client-reactnative/src/stores/accountStore.ts - About 1 hr to fix

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 ===

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

Consider simplifying this complex logical expression.
Open

    if (
        data.botName &&
        data.botAddress &&
        data.botPassword &&
        data.conferenceAddress &&
Severity: Critical
Found in bots/huthut/config/connect.js - About 1 hr to fix
Severity
Category
Status
Source
Language