dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function userSteps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const userSteps = (type, jid, step, newData) => {
    //Get the index of the user in the array by his jid
    const userIndex = userStepsList.findIndex(user => user.name === jid);

    //If the user with the specified jid is not found, create a new data object for him.
Severity: Minor
Found in bots/gptBot/actions.js - About 35 mins 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 helloMessageHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const helloMessageHandler = (data) => {
    console.log('=> helloMessageHandler || Message received from ', data.userJID, data.message);
    userData('setData', data.userJID, '', 'deleteItem');

    getUserData(data.userJID).then(userData => {
Severity: Minor
Found in bots/merchantBot/handlers/helloMessage.js - About 35 mins 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 errorHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const errorHandler = (data) => {
    console.log('=> errorHandler | Message received from ', data.receiver, data.message);
    if (data.userStep === 2) {
        if(data.receiverData.attrs.isSystemMessage){
            return sendMessage(
Severity: Minor
Found in bots/huthut/handlers/error.js - About 35 mins 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 userSteps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const userSteps = (type, jid, step, newData) => {
    //Get the index of the user in the array by his jid
    const userIndex = userStepsList.findIndex(user => user.name === jid);

    //If the user with the specified jid is not found, create a new data object for him.
Severity: Minor
Found in bots/autoResponder/actions.js - About 35 mins 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 userSteps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const userSteps = (type, jid, step, newData) => {
    //Get the index of the user in the array by his jid
    const userIndex = userStepsList.findIndex(user => user.name === jid);

    //If the user with the specified jid is not found, create a new data object for him.
Severity: Minor
Found in bots/translateBot/actions.js - About 35 mins 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 userSteps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const userSteps = (type, jid, step, newData) => {
    //Get the index of the user in the array by his jid
    const userIndex = userStepsList.findIndex(user => user.name === jid);

    //If the user with the specified jid is not found, create a new data object for him.
Severity: Minor
Found in bots/botTemplate/actions.js - About 35 mins 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 EmailSingInForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function EmailSingInForm(props: TProps) {
  const history = useHistory();
  const setUser = useStoreState((state) => state.setUser);
  const [disable, setDisable] = useState(false);
  const [showPassword, setShowPassword] = useState(false);
Severity: Minor
Found in client-web/src/pages/Signon/EmailSignInForm.tsx - About 35 mins 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 EmailSignUpForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function EmailSignUpForm(props: TProps) {
  const [showPassword, setShowPassword] = useState(false);
  const [openSnack, setOpenSnack] = useState(false);
  const [errorMsg, setErrorMsg] = useState("");
  const history = useHistory();
Severity: Minor
Found in client-web/src/pages/Signon/EmailSignUpForm.tsx - About 35 mins 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 UsernameSignInForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function UsernameSignInForm(props: TProps) {
  const setUser = useStoreState((state) => state.setUser);
  const history = useHistory();
  const formik = useFormik({
    initialValues: {
Severity: Minor
Found in client-web/src/pages/Signon/UsernameSignInForm.tsx - About 35 mins 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 Referrals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const Referrals: React.FC<IReferrals> = ({}) => {
  const link = useStoreState((state) => state.user._id);
  const walletAddress = useStoreState((state) => state.user.walletAddress);

  const setBalance = useStoreState((state) => state.setBalance);
Severity: Minor
Found in client-web/src/pages/Referrals/Referrals.tsx - About 35 mins 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 UsernameSignUpForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function UsernameSignUpForm(props: TProps) {
  const history = useHistory();
  const setUser = useStoreState((state) => state.setUser);

  const [showPassword, setShowPassword] = useState(false);
Severity: Minor
Found in client-web/src/pages/Signon/UsernameSignUpForm.tsx - About 35 mins 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 DocumentHistoryScreen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const DocumentHistoryScreen = ({route, navigation}: ScreenProps) => {
  const {item, userWalletAddress} = route.params;

  const {loginStore, walletStore} = useStores();

Severity: Minor
Found in client-reactnative/src/Screens/Profile/DocumentHistoryScreen.tsx - About 35 mins 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 OtherUserProfileScreen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const OtherUserProfileScreen = observer(({route}: ScreenProps) => {
  const {loginStore, walletStore, apiStore, chatStore, otherUserStore} =
    useStores();
  const navigation = useNavigation<HomeStackNavigationProp>();

Severity: Minor
Found in client-reactnative/src/Screens/Profile/OtherUserProfileScreen.tsx - About 35 mins 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 TransactionsList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  ({transactions, walletAddress, onEndReached}: TransactionListProps) => {
    const [activeFilter, setActiveFilter] = useState(FILTERS.all);
    const getFilteredTransactions = () => {
      if (activeFilter === FILTERS.all) {
        return transactions;
Severity: Minor
Found in client-reactnative/src/components/Transactions/TransactionsList.tsx - About 35 mins 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 ProfileModal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const ProfileModal = (props: ProfileModalProps) => {
  const {
    isVisible,
    onBackdropPress,
    modalType,
Severity: Minor
Found in client-reactnative/src/components/Modals/Profile/ProfileModal.tsx - About 35 mins 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 loginOrRegisterSocialUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const loginOrRegisterSocialUser = async (
  user: any,

  defaultToken: string,
  loginUser: any,
Severity: Minor
Found in client-reactnative/src/helpers/login/socialLoginHandle.ts - About 35 mins 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

Avoid too many return statements within this function.
Open

            return botInitiate(handlerData);
Severity: Major
Found in bots/raffle/router.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return sendMessage(
                handlerData,
                messages.visitingHut.tnxForTransaction,
                'message',
                false,
Severity: Major
Found in bots/huthut/router.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return leaveHandler(handlerData);
Severity: Major
Found in bots/huthut/router.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return helpHandler(handlerData);
Severity: Major
Found in bots/huthut/router.js - About 30 mins to fix
Severity
Category
Status
Source
Language