dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function getWritingTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const getWritingTime = (message) => {
    if (message.length <= 120) {
        return 2000
    }
    if (message.length <= 250 && message.length > 120) {
Severity: Minor
Found in bots/gptBot/actions.js - About 25 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 getRandomNFT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const getRandomNFT = (itemsList) => {
    if (itemsList.success && itemsList.balance.length > 0) {
        const filteredItems = itemsList.balance.filter(item => item.tokenType === 'NFT' && item.balance > 0);
        if (filteredItems.length <= 0) {
            return [];
Severity: Minor
Found in bots/raffle/handlers/helpers/getRandomNFT.js - About 25 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 xmppSender has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Minor
Found in bots/botTemplate/actions.js - About 25 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 xmppSender has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Minor
Found in bots/autoResponder/actions.js - About 25 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 xmppSender has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Minor
Found in bots/gptBot/actions.js - About 25 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 OwnerRegistration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function OwnerRegistration({ open, setOpen }: TProps) {
  const setOwner = useStoreState((state) => state.setOwner);
  const history = useHistory();
  const [termsOpen, setTermsOpen] = useState(false);
  const [loading, setLoading] = useState(false);
Severity: Minor
Found in client-web/src/pages/Signon/OwnerRegistrationModal.tsx - About 25 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 TransactionDetails has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const TransactionDetails: React.FC<ITransactionDetailsProps> = (
  props
) => {
  const [transactionDetails, setTransactionDetails] = useState<
    ITransaction | {}
Severity: Minor
Found in client-web/src/pages/Explorer/TransactionDetails.tsx - About 25 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 ManageData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const ManageData = (props: ManageDataProps) => {
  const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false);
  const [loading, setLoading] = React.useState(false);
  const { showSnackbar } = useSnackbar();
  const clearUser = useStoreState((state) => state.clearUser);
Severity: Minor
Found in client-web/src/pages/Privacy/ManageData.tsx - About 25 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 Provenance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const Provenance: React.FC<IProvenance> = ({}) => {
  const location = useLocation<{
    nftItem: TBalance & IDocument;
    walletAddress: string;
  }>();
Severity: Minor
Found in client-web/src/pages/Transactions/Provenance.tsx - About 25 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 ChangeImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function ChangeImage({ open, setOpen }: TProps) {
  const user = useStoreState((state) => state.user);
  const setUser = useStoreState((state) => state.setUser);
  const fileRef = useRef<HTMLInputElement>(null);
  const [imgSrc, setImgSrc] = useState("");
Severity: Minor
Found in client-web/src/pages/Profile/ChangeImage.tsx - About 25 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 MembersList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function MembersList() {
  const { roomJID }: any = useParams();
  const userChatRooms = useStoreState((store) => store.userChatRooms);
  const membersList = useStoreState((store) =>
    store.roomMemberInfo.filter((item) => item.name !== "none")
Severity: Minor
Found in client-web/src/pages/ChatRoomDetails/MembersList.tsx - About 25 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 BlockDetails has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function BlockDetails(props) {
  const [blockDetails, setBlockDetails] = useState<IBlock | {}>({});
  const [loading, setLoading] = useState(false);
  const params = useParams<{ blockNumber: string }>();
  const getDetails = async () => {
Severity: Minor
Found in client-web/src/pages/Explorer/BlockDetails.tsx - About 25 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 DocumentsShare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const DocumentsShare = (props: DocumentsShareProps) => {
  const [tab, setTab] = React.useState(0);
  const [openModal, setOpenModal] = React.useState(false);
  const [loading, setLoading] = React.useState(false);
  const [sharedLinks, setSharedLinks] = React.useState<ISharedLink[]>([]);
Severity: Minor
Found in client-web/src/pages/Privacy/DocumentsShareTab.tsx - About 25 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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const validate = (values: Record<string, string>) => {
  const errors: Record<string, string> = {};

  if (!values.email) {
    errors.email = "Required";
Severity: Minor
Found in client-web/src/pages/Signon/EmailSignUpForm.tsx - About 25 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 TransferItemsModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function TransferItemsModal({ open, setOpen, item }: TProps) {
  const [loading, setLoading] = useState(false);
  const setBalance = useStoreState((state) => state.setBalance);
  const balance = useStoreState((state) => state.balance);

Severity: Minor
Found in client-web/src/pages/Profile/TransferItemsModal.tsx - About 25 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 MetamaskModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function MetamaskModal({ open, setOpen }: TProps) {
  const { account, library, deactivate } = useWeb3React();
  const setUser = useStoreState((state) => state.setUser);
  const history = useHistory();
  const formik = useFormik({
Severity: Minor
Found in client-web/src/pages/Signon/MetamaskModal.tsx - About 25 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 ProfileShareTab has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const ProfileShareTab = (props: ProfileShareTabProps) => {

    const [tab, setTab] = React.useState(0);
    const [loading, setLoading] = React.useState(false);
    const [sharedLinks, setSharedLinks] = React.useState<ISharedLink[]>([]);
Severity: Minor
Found in client-web/src/pages/Privacy/ProfileShareTab.tsx - About 25 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 HeaderMenu has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const HeaderMenu = () => {
  const navigation = useNavigation<HomeStackNavigationProp>();
  const [open, setOpen] = useState(false);

  const {loginStore, debugStore} = useStores();
Severity: Minor
Found in client-reactnative/src/components/MainHeader/HeaderMenu.tsx - About 25 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 produceNfmtItems has a Cognitive Complexity of 6 (exceeds 5 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 25 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 SocialButton has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const SocialButton = (props: SocialButtonProps) => {
  const {label, color, fontFamily, fontSize, leftIcon, bg, _pressed, onPress} =
    props;
  return (
    <Button
Severity: Minor
Found in client-reactnative/src/components/Buttons/SocialButton.tsx - About 25 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

Severity
Category
Status
Source
Language