dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function renderDirections has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderDirections = (direction: string) => {
    const oppositePreviousDirection = getOpositeDirection(previousDirection);
    if (checkEmptyDirections() && direction === oppositePreviousDirection) {
      return (
        <CompassItem
Severity: Minor
Found in client-web/src/components/MetaNavigation/MetaNavigation.tsx - About 1 hr to fix

Function sendCoins has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const sendCoins = async (amount?: number) => {
    const currentCoinAmount = amount ? Number(amount) : Number(coinAmount);
    try {
      const res = await transferCoin(
        "DPT",
Severity: Minor
Found in client-web/src/components/Chat/ChatTransferDialog.tsx - About 1 hr to fix

Function onEnd has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function onEnd(
  p: Participant,
  client: Client,
  walletAddress: string
) {
Severity: Minor
Found in bots/exportToUSDC/src/questions.create.ts - About 1 hr to fix

Function roomConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  roomConfig(to: string, data: { roomName: string; roomDescription?: string }) {
    const message = xml(
      "iq",
      {
        from: this.client.jid?.toString(),
Severity: Minor
Found in client-web/src/xmpp.ts - About 1 hr to fix

Function TokensGraph has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function TokensGraph({}: Props) {
  const theme = useTheme()
  return (
    <div className="dashboard-graph" style={{ marginRight: "10px" }}>
      <a className="title" onClick={(e) => e.preventDefault()} href="/">
Severity: Minor
Found in client-web/src/pages/Dashboard/TokensGraph.tsx - About 1 hr to fix

Function roomConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const roomConfig = (
  from: string,
  to: string,
  data: {roomName: string; roomDescription: string},
  xmpp: any,
Severity: Minor
Found in client-reactnative/src/xmpp/stanzas.ts - About 1 hr to fix

Function onStopRecord has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onStopRecord = async () => {
    setRecording(false);
    animateMediaButtonOut();

    const result = await audioRecorderPlayer.stopRecorder();
Severity: Minor
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 1 hr to fix

Function renderDirections has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderDirections = (direction: string) => {
    const oppositePreviousDirection = getOpositeDirection(previousDirection);
    if (checkEmptyDirections() && direction === oppositePreviousDirection) {
      return (
        <CompassItem
Severity: Minor
Found in client-reactnative/src/components/Chat/MetaNavigation.tsx - About 1 hr to fix

Function loadTabContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const loadTabContent = () => {
    if (activeTab === 0) {
      return (
        <ProfileTabs
          activeAssetTab={activeAssetTab}
Severity: Minor
Found in client-reactnative/src/Screens/Profile/OtherUserProfileScreen.tsx - About 1 hr to fix

Function PrivacyAndDataScreen has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const PrivacyAndDataScreen = () => {
  const [routeIndex, setRouteIndex] = useState(0);

  const routes = [
    {key: 'visibility', title: 'Visibility'},
Severity: Minor
Found in client-reactnative/src/Screens/Privacy/PrivacyAndDataScreen.tsx - About 1 hr to fix

Function loadTabContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const loadTabContent = () => {
    if (activeTab === 0) {
      return (
        <ProfileTabs
          activeAssetTab={activeAssetTab}
Severity: Minor
Found in client-reactnative/src/Screens/Profile/ProfileScreen.tsx - About 1 hr to fix

Function ChangeUserDescriptionModal has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ChangeUserDescriptionModal = (props: ChangeUserDescriptionModalProps) => {
  const {modalVisible, setModalVisible, currentDescription, changeDescription} =
    props;

  const [newDescription, setNewDescription] =

Function handleOnLongPress has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const handleOnLongPress = (message: any) => {
    let extraData = {};
    if (
      message.user._id.includes(
        underscoreManipulation(loginStore.initialData.walletAddress),
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 1 hr to fix

Function sendMessage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const sendMessage = (messageString: any, isSystemMessage: boolean) => {
    const messageText = messageString[0].text;
    const tokenAmount = messageString[0].tokenAmount || 0;
    const receiverMessageId = messageString[0].receiverMessageId || 0;
    const manipulatedWalletAddress = underscoreManipulation(
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 1 hr to fix

Function ChatAvatar has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export function ChatAvatar({ roomJID, onDeleteRoomClick }: IRoomAvatar) {
  const currentRoomData = useStoreState((store) => store.userChatRooms).find(
    (e) => e?.jid === roomJID
  );
  const updateUserChatRoom = useStoreState((state) => state.updateUserChatRoom);
Severity: Minor
Found in client-web/src/pages/ChatRoomDetails/ChatAvatar.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 deployNfmt has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

  type: string,
  name: string,
  symbol: string,
  description: string,
  owner: string,
Severity: Major
Found in client-web/src/http.ts - About 1 hr to fix

Function RoomDetailsCard has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const RoomDetailsCard = (props: RoomDetailsCardProps) => {
  //component props
  const {
    onImagePress,
    room,

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 RegularLoginScreen has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const RegularLoginScreen = ({navigation}: ScreenProps) => {
  const [userName, setUserName] = useState('');
  const [password, setPassword] = useState('');
  const [isLoading, setisLoading] = useState(false);
  const {loginStore} = useStores();
Severity: Minor
Found in client-reactnative/src/Screens/Login/RegularLoginScreen.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 LoginScreen has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const LoginScreen = observer(({navigation}: LoginScreenProps) => {
  const {loginStore, apiStore} = useStores();
  const {isFetching} = loginStore;
  const connector = useWalletConnect();
  const [externalWalletModalData, setExternalWalletModalData] = useState({
Severity: Minor
Found in client-reactnative/src/Screens/Login/LoginScreen.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 RoomsTabBar has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const RoomsTabBar = observer(() => {
  const {chatStore} = useStores();
  const privateRooms = chatStore.roomList?.filter((item: any) => {
    const splitedJid = item?.jid?.split('@')[0];

Severity: Minor
Found in client-reactnative/src/components/RoomList/RoomsTabBar.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

Severity
Category
Status
Source
Language