dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function openDirectChat has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const openDirectChat = () => {
    createPrivateChat(
      user.walletAddress,
      walletAddress,
      user.firstName,
Severity: Minor
Found in client-web/src/pages/Profile/UserCard.tsx - About 1 hr to fix

Function roomConfigurationForm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const roomConfigurationForm = (
  user_jid: string,
  chat_jid: string,
  roomConfig: any,
  xmpp: any,
Severity: Minor
Found in client-reactnative/src/xmpp/stanzas.ts - About 1 hr to fix

Function onSubmit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    onSubmit: (fd) => {
      setDisableSubmit(true);
      registerUsername(fd.username, fd.password, fd.firstName, fd.lastName)
        .then((resp) => {
          loginUsername(fd.username, fd.password).then((result) => {
Severity: Minor
Found in client-web/src/pages/Signon/UsernameSignUpForm.tsx - About 1 hr to fix

Function generateValueFromPartsAndChangedText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const generateValueFromPartsAndChangedText = (
  parts: Part[],
  originalText: string,
  changedText: string,
) => {
Severity: Minor
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 1 hr to fix

Function submitMediaMessage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const submitMediaMessage = (
    mediaListArray: IMediaProps[],
    roomDetail: roomListProps,
    xmpp: any,
    waveForm?: any,
Severity: Minor
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 1 hr to fix

Function App has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const App = () => {
  React.useEffect(() => {
    const unsubscribe = NetInfo.addEventListener(state => {
      console.log('Connection type', state.type);
      console.log('Is connected?', state.isConnected);
Severity: Minor
Found in client-reactnative/src/App.tsx - About 1 hr to fix

Function onStopRecord has 28 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/Screens/Chat/ChatExperimental.tsx - About 1 hr to fix

Function startMint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const startMint = (data) => {
    console.log('=> startMint | Message received from ', data.userJID, data.message);
    getMintItemData(data.receiverData.attrs.contractAddress).then(itemsData => {
        console.log('GET MINT ITEM DATA => ', itemsData)

Severity: Minor
Found in bots/merchantBot/handlers/startMint.js - 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 router has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const router = (handlerData) => {
    const roomMuteIndex = muteRoomList.indexOf(handlerData.roomJID)

    if(roomMuteIndex > -1){
        if (messageCheck(handlerData.message, 'start translate') ||
Severity: Minor
Found in bots/translateBot/router.js - 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 generateMessage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const generateMessage = (data, message, isSystemMessage, noName) => {
    let userName;
    let finalMessage;

    //Getting username
Severity: Minor
Found in bots/raffle/actions.js - 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 Visibility has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const Visibility: React.FC<VisibilityProps> = ({ handleChangeTab }) => {
  const updateUserProfilePermission = useStoreState(
    (state) => state.updateUserProfilePermission
  );
  const updateUserDocumentsPermission = useStoreState(
Severity: Minor
Found in client-web/src/pages/Privacy/VisibilityTab.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 DocumentsCreateModal has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export default function DocumentsCreateModal(props: TProps) {
  const [loading, setLoading] = React.useState(false);

  const formik = useFormik({
    initialValues: {
Severity: Minor
Found in client-web/src/pages/Profile/DocumentsCreateModal.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 UserCard has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export default function UserCard({ profile, walletAddress }: TProps) {
  const [edit, setEdit] = useState(false);
  const user = useStoreState((state) => state.user);
  const [showQrModal, setShowQrModal] = useState(false);

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

const QRCodeGenerator = (props: QRCodeGeneratorProps) => {
  const svg = useRef(null);
  const {apiStore} = useStores();
  const {shareKey, close} = props;

Severity: Minor
Found in client-reactnative/src/components/QRCodeGenerator.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 timerId has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let timerId = setInterval(() => {
        const currentTime = new Date();

        let timeDifference = Math.abs(addedTime.getTime() - currentTime.getTime());
        let differenceUnMinutes = (timeDifference / 1000) / 60;
Severity: Minor
Found in bots/raffle/handlers/helpers/messagingTimeout.js - About 1 hr to fix

Function messages has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const messages = () => {
    return {
        general: {
            welcomeMessage: 'Hey! Questionnaire  Bot launched',
            botStatusOnline: 'Questionnaire bot Online',
Severity: Minor
Found in bots/questionnaire/config/messages.js - About 1 hr to fix

Function startMint has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const startMint = (data) => {
    console.log('=> startMint | Message received from ', data.userJID, data.message);
    getMintItemData(data.receiverData.attrs.contractAddress).then(itemsData => {
        console.log('GET MINT ITEM DATA => ', itemsData)

Severity: Minor
Found in bots/merchantBot/handlers/startMint.js - About 1 hr to fix

Function transferItemHandler has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const transferItemHandler = (data) => {
    logCurrentHandler('transferItemHandler', data.userJID, data.message);
    getBalance().then(result => {
        const randomItem = getRandomNFT(result)[0];
        if (randomItem) {
Severity: Minor
Found in bots/raffle/handlers/transferItemHandler.js - About 1 hr to fix

Function CustomMessageInput has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CustomMessageInput = (props: CustomMessageInputProps) => {

    const {
        onPaste,
        placeholder,
Severity: Minor
Found in client-web/src/components/Chat/Threads/CustomMessageInput.tsx - About 1 hr to fix

Function updateAcl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const updateAcl = async () => {
    setLoading(true);
    try {
      const filteredApplication = Object.fromEntries(
        Object.entries(userAcl!.result!.application).map((item) => {
Severity: Minor
Found in client-web/src/components/EditAcl.tsx - About 1 hr to fix
Severity
Category
Status
Source
Language