dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function Signon has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export default function Signon() {
  const setUser = useStoreState((state) => state.setUser);
  const user = useStoreState((state) => state.user);
  const query = useQuery();
  const history = useHistory();
Severity: Minor
Found in client-web/src/pages/Signon/index.tsx - About 55 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 getPartsInterval has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

const getPartsInterval = (
  parts: Part[],
  cursor: number,
  count: number,
): Part[] => {
Severity: Minor
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 55 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 getPushToken has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const getPushToken = async (
  walletAddress: string,
  DOMAIN: string,
  defaultUrl: string,
  navigation: HomeStackNavigationProp,
Severity: Minor
Found in client-reactnative/src/helpers/pushNotifications.ts - About 55 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 transferTokens has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  async transferTokens(
    bodyData: any,
    token: string,
    fromWallet: string,
    senderName: string,
Severity: Minor
Found in client-reactnative/src/stores/walletStore.ts - About 55 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 mapTransactions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const mapTransactions = (item: any, walletAddress: string) => {
  if (item.tokenId === 'NFT') {
    if (item.from === walletAddress && item.from !== item.to) {
      item.balance = item.senderBalance + '/' + item.nftTotal;
    } else {
Severity: Minor
Found in client-reactnative/src/stores/walletStore.ts - About 55 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 DocumentShareManage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const DocumentShareManage: React.FC<IDocumentShareManage> = ({
  onAddPress,
}) => {
  const [sharedLinks, setSharedLinks] = useState<ISharedLink[]>([]);
  const {loginStore} = useStores();
Severity: Minor
Found in client-reactnative/src/Screens/Privacy/DocumentShareManage.tsx - About 55 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 ProfileShareManage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const ProfileShareManage: React.FC<IProfileShareManage> = ({
  onAddPress,
}) => {
  const [sharedLinks, setSharedLinks] = useState<ISharedLink[]>([]);
  const {loginStore, apiStore} = useStores();
Severity: Minor
Found in client-reactnative/src/Screens/Privacy/ProfileShareManage.tsx - About 55 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 deeply nested control flow statements.
Open

              if (
                currentSavedChatRoom.length > 0 &&
                currentSavedChatRoom[0].toUpdate
              ) {
                useStoreState.getState().updateUserChatRoom(roomData);
Severity: Major
Found in client-web/src/xmppHandler.ts - About 45 mins to fix

Function router has a Cognitive Complexity of 8 (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/botTemplate/router.js - About 45 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 EditAcl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const EditAcl: React.FC<IEditAcl> = ({ userId, updateData }) => {
  const [userAcl, setUserAcl] = useState<IUserAcl>();
  const [userAclApplicationKeys, setUserAclApplicationKeys] = useState<
    Array<TKeys>
  >([]);
Severity: Minor
Found in client-web/src/components/EditAcl.tsx - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
Open

export const produceNfmtItems = (array = []) => {
  const result = [];
  const rareTotal = 20;
  const uniqueTotal = 1;

Severity: Minor
Found in client-web/src/utils/index.ts - About 45 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 Row has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const Row = ({
  name,
  row,
  onChange,
  disableAllRow,
Severity: Minor
Found in client-web/src/components/EditAcl.tsx - About 45 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 getPosition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const getPosition = (
  arr: TMessageHistory[],
  message: TMessageHistory,
  index: number
) => {
Severity: Minor
Found in client-web/src/utils/index.ts - About 45 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 OtherProfile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function OtherProfile(props: TProps) {
  const [loading, setLoading] = useState(true);
  const [profile, setProfile] = useState<TProfile>();
  const [transactions, setTransactions] =
    useState<ExplorerRespose<ITransaction[]>>();
Severity: Minor
Found in client-web/src/pages/Profile/OtherProfile.tsx - About 45 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 deeply nested control flow statements.
Open

            if (isValid) {
              // next question
              participant.answers[currentQuestion.name] = participant.msg
              await nextMessage(
                participant,
Severity: Major
Found in bots/createBot/src/index.create.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (START_BOT_COMMANDS.includes(msgText.toLocaleLowerCase())) {
              const data = stanza.getChild("data");

              if (data) {
                const newParticipant: Participant = {
Severity: Major
Found in bots/exportToUSDC/src/index.exportToUSDC.ts - About 45 mins to fix

Function repeatMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  participant: Participant,
  questions: Question[],
  participants: { [key: string]: Participant },
  onEnd: (p: Participant, client: Client, walletAddress: string) => Promise<void>,
  client: Client,
Severity: Minor
Found in bots/createBot/src/utils.ts - About 45 mins to fix

Function nextMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  participant: Participant,
  questions: Question[],
  participants: { [key: string]: Participant },
  onEnd: (p: Participant, client: Client, walletAddress: string) => Promise<void>,
  client: Client,
Severity: Minor
Found in bots/createBot/src/utils.ts - About 45 mins to fix

Function nextMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  participant: Participant,
  questions: Question[],
  participants: { [key: string]: Participant },
  onEnd: (p: Participant, client: Client, walletAddress: string) => Promise<void>,
  client: Client,
Severity: Minor
Found in bots/exportToUSDC/src/utils.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (isValid) {
              // next question
              participant.answers[currentQuestion.name] = participant.msg;
              await nextMessage(
                participant,
Severity: Major
Found in bots/exportToUSDC/src/index.exportToUSDC.ts - About 45 mins to fix
Severity
Category
Status
Source
Language