dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function EditAppModal has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export default function EditAppModal({ open, setOpen, app }: TProps) {
  const fileRef = React.useRef<HTMLInputElement>(null);
  const [loading, setLoading] = useState(false)
  const updateApp = useStoreState(state => state.updateApp)

Severity: Minor
Found in client-web/src/pages/Owner/EditAppModal.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 MetaNavigation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const MetaNavigation: React.FC<IMetaNavigation> = ({
  chatId,
  open,
  onClose,
}) => {
Severity: Minor
Found in client-reactnative/src/components/Chat/MetaNavigation.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 ChangeBackgroundScreen has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const ChangeBackgroundScreen = observer((props: any) => {
  const navigation = useNavigation();
  const {chatStore, loginStore, apiStore} = useStores();
  const roomJID = props.route.params.roomJID;

Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChangeBackgroundScreen.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 AuthenticationScreen has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const AuthenticationScreen: React.FC<IAuthentication> = ({ }) => {

  //mobx stores
  const { loginStore } = useStores();
  //mobx stores
Severity: Minor
Found in client-reactnative/src/Screens/Account/Authentication.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 ChatScreen has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const ChatScreen = observer(({route}: any) => {
  const {chatStore} = useStores();

  const {chatJid, chatName} = route.params;
  const room:roomListProps = chatStore.roomList.find(item => item.jid === chatJid)||{
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatScreen.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 fetchWalletBalance has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async fetchWalletBalance(token: string, isOwn: boolean) {
    let url = tokenEtherBalanceURL;
    runInAction(() => {
      this.isFetching = true;
    });
Severity: Minor
Found in client-reactnative/src/stores/walletStore.ts - About 1 hr to fix

Function downloadFile has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const downloadFile = async (url: string, filename: string) => {
  // Get today's date to add the time suffix in filename
  var date = new Date();

  const {
Severity: Minor
Found in client-reactnative/src/helpers/downloadFile.ts - About 1 hr to fix

Function getConnectData has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getConnectData = async () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server');
    let dataBaseStatus = false;
    if (
        !process.env.TYPE ||
Severity: Minor
Found in bots/translateBot/config/connect.js - About 1 hr to fix

Function getConnectData has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getConnectData = async () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server');
    let dataBaseStatus = false;
    if (
        !process.env.TYPE ||
Severity: Minor
Found in bots/raffle/config/connect.js - About 1 hr to fix

Function getConnectData has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getConnectData = async () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server');
    let dataBaseStatus = false;
    if (
        !process.env.TYPE ||
Severity: Minor
Found in bots/botTemplate/config/connect.js - About 1 hr to fix

Function sendMediaMessageStanza has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const sendMediaMessageStanza = async (
  from: string,
  to: string,
  data: any,
  xmpp: any,
Severity: Minor
Found in client-reactnative/src/xmpp/stanzas.ts - About 1 hr to fix

Function getMentionPartSuggestionKeywords has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getMentionPartSuggestionKeywords = (
  parts: Part[],
  plainText: string,
  selection: Position,
  partTypes: PartType[],
Severity: Minor
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 1 hr to fix

Function HeaderBalanceButton has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const HeaderBalanceButton = observer(() => {
  const {walletStore} = useStores();
  const navigation = useNavigation<HomeStackNavigationProp>();
  const onButtonPress = () => {
    navigation.navigate('ProfileScreen');

Function onDirectMessagePress has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onDirectMessagePress = async () => {
    const otherUserWalletAddress = dataForTransfer?.walletFromJid;
    const myWalletAddress = loginStore.initialData.walletAddress;
    const combinedWalletAddress = [myWalletAddress, otherUserWalletAddress]
      .sort()

Function sendMediaMessageStanza has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  sendMediaMessageStanza(roomJID: string, data: any) {
    const message = xml(
      "message",
      {
        id: "sendMessage",
Severity: Minor
Found in client-web/src/xmpp.ts - About 1 hr to fix

Function onDirectChatPress has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onDirectChatPress = () => {
    const otherUserWalletAddress = loginStore.anotherUserWalletAddress;
    const myWalletAddress = loginStore.initialData.walletAddress;
    const combinedWalletAddress = [myWalletAddress, otherUserWalletAddress]
      .sort()
Severity: Minor
Found in client-reactnative/src/Screens/Profile/OtherUserProfileScreen.tsx - About 1 hr to fix

Function getConnectData has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getConnectData = async () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server');
    let dataBaseStatus = false;
    if (
        !process.env.TYPE ||
Severity: Minor
Found in bots/autoResponder/config/connect.js - About 1 hr to fix

Function getConnectData has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getConnectData = async () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server');
    let dataBaseStatus = false;
    if (
        !process.env.TYPE ||
Severity: Minor
Found in bots/gptBot/config/connect.js - About 1 hr to fix

Function Privacy has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Privacy = () => {
  const [tab, setTab] = useState(0);

  const handleChangeTab = (event: React.SyntheticEvent, newValue: number) => {
    setTab(newValue);
Severity: Minor
Found in client-web/src/pages/Privacy/Privacy.tsx - About 1 hr to fix

Function message has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    message: async (p) => {
      return {
        messages: [
          {
            type: 'text',
Severity: Minor
Found in bots/createBot/src/questions.create.ts - About 1 hr to fix
Severity
Category
Status
Source
Language