dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function RootStack has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RootStack = observer(() => {
  const {loginStore} = useStores();
  const {
    setTokenFromAsyncStorage,
    setInitialDetailsFromAsyncStorage,
Severity: Minor
Found in client-reactnative/src/navigation/RootStack.tsx - About 1 hr to fix

Function generateValueWithAddedSuggestion has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function AppTopNav has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const AppTopNav = () => {
  const currentUntrackedChatRoom = useStoreState(
    (store) => store.currentUntrackedChatRoom
  );
  const chatUrl = currentUntrackedChatRoom
Severity: Minor
Found in client-web/src/components/AppTopNav.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 13 (exceeds 5 allowed). Consider refactoring.
Open

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

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

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

export default function CreateApp() {
  const [loading, setLoading] = React.useState(false);
  const fileRef = React.useRef<HTMLInputElement>(null);

  const formik = useFormik({
Severity: Minor
Found in client-web/src/pages/CreateApp/index.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 onSubmit has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    onSubmit: (values) => {
      setDisableSubmit(true);
      loginUsername(values.username, values.password)
        .then((result) => {
          setUser({
Severity: Minor
Found in client-web/src/pages/Signon/UsernameSignInForm.tsx - About 1 hr to fix

Function getPartsInterval has 39 lines of code (exceeds 25 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 1 hr to fix

Function insertTransaction has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  new Promise(async (resolve, reject) => {
    data.map(item => {
      if (!item.nftTotal) item.nftTotal = '0';
      const data = {
        blockNumber: item.blockNumber ? item.blockNumber : 0,
Severity: Minor
Found in client-reactnative/src/components/realmModels/transaction.ts - About 1 hr to fix

Function getPosition has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getPosition = (
  arr: TMessageHistory[],
  message: TMessageHistory,
  index: number
) => {
Severity: Minor
Found in client-web/src/utils/index.ts - About 1 hr to fix

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

export const getConnectData = async () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server');

    if (
        !process.env.TYPE ||
Severity: Minor
Found in bots/merchantBot/config/connect.js - About 1 hr to fix

Function LeftActions has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const LeftActions = (props: LeftActionsProps) => {
  const {toggleNotification, swipeRef, name, jid, renameChat} = props;
  const {chatStore} = useStores();
  return (
    <>

Function renderAttachment has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderAttachment = () => {
    const options = walletStore.nftItems.length
      ? {
          'Upload File': async () => await sendAttachment(),
          'Display an Item': async () => await displayNftItems(),
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 1 hr to fix

Method initializeFlipper has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
    if (FlipperUtils.shouldEnableFlipper(context)) {
      final FlipperClient client = AndroidFlipperClient.getInstance(context);

      client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));

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

export const getConnectData = async () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server');

    if (
        !process.env.TYPE ||
Severity: Minor
Found in bots/questionnaire/config/connect.js - About 1 hr to fix

Function helpHandler has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const helpHandler = (data) => {
    console.log('=> helpHandler | Message received from ', data.receiver, data.message);

    if(data.userStep === 1){
        return sendMessage(
Severity: Minor
Found in bots/huthut/handlers/help.js - About 1 hr to fix

Function onMintClick has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onMintClick = () => {
    if (!avatarSource) {
      showToast('error', 'Error', 'Please load the image.', 'top');
      return;
    }
Severity: Minor
Found in client-reactnative/src/Screens/MintScreen.tsx - About 1 hr to fix

Function removeListener has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    const removeListener = Linking.addEventListener('url', data => {
      if (data.url) {
        if (data.url.includes('profileLink')) {
          const params = data.url.split(appLinkingUrl)[1];
          const queryParams = new URLSearchParams(params);
Severity: Minor
Found in client-reactnative/src/navigation/HomeStack.tsx - About 1 hr to fix

Function loginOrRegisterSocialUser has 37 lines of code (exceeds 25 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 1 hr to fix

Function renderAttachment has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderAttachment = () => {
    const options = walletStore.nftItems.length
      ? {
          'Upload File': async () =>
            await sendAttachment(loginStore.userToken, roomDetails),
Severity: Minor
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 1 hr to fix
Severity
Category
Status
Source
Language