dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

Identical blocks of code found in 7 locations. Consider refactoring.
Open

const getBotName = (str) => {
    try {
        return str.replace(/([A-Z])/g, '_$1').toLowerCase();
    } catch (error) {
        console.log('getBotName error: ', error);
Severity: Major
Found in bots/merchantBot/config/connect.js and 6 other locations - About 1 hr to fix
bots/autoResponder/config/connect.js on lines 56..62
bots/botTemplate/config/connect.js on lines 58..64
bots/gptBot/config/connect.js on lines 56..62
bots/questionnaire/config/connect.js on lines 47..53
bots/raffle/config/connect.js on lines 58..64
bots/translateBot/config/connect.js on lines 58..64

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        {isAllowedToChangeData && (
          <IconButton
            onClick={() => setShowRoomRenameModal(true)}
            style={{
              marginLeft: 10,
Severity: Major
Found in client-web/src/pages/ChatRoomDetails/ChatDetailCard.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/ChatRoomDetails/ChatDetailCard.tsx on lines 94..103

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      <Box sx={{ margin: 2, display: "flex", justifyContent: "center" }}>
        <Button type="submit" variant="contained">
          Continue
        </Button>
      </Box>
Severity: Major
Found in client-web/src/pages/Signon/EmailSignUpForm.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Signon/MetamaskModal.tsx on lines 132..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    try {
      const res = await httpPost(url, item, loginStore.userToken);
      // alert(JSON.stringify(res.data))

      debugStore.addLogsApi(res.data);
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/Actions/UploadDocumentsScreen.tsx on lines 89..98

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        {isAllowedToChangeData && (
          <IconButton
            onClick={() => setShowDescriptionModal(true)}
            style={{
              marginLeft: 10,
Severity: Major
Found in client-web/src/pages/ChatRoomDetails/ChatDetailCard.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/ChatRoomDetails/ChatDetailCard.tsx on lines 70..79

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      ) {
        Alert.alert(
          'No Internet Connection',
          'Connect your phone to the Internet by using an available Wi-Fi or cellular network.',
          [
Severity: Major
Found in client-reactnative/src/helpers/login/socialLoginHandle.ts and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx on lines 154..165

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  const deleteRoomDialog = async () => {
    Alert.alert('Delete', 'Do you want to delete this room?', [
      {
        text: 'Cancel',
        onPress: () => console.log('canceled'),
Severity: Major
Found in client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/helpers/login/socialLoginHandle.ts on lines 132..147

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    try {
      const res = await httpPost(url, item, loginStore.userToken);
      // alert(JSON.stringify(res.data))

      debugStore.addLogsApi(res.data);
client-reactnative/src/Screens/UploadDocumentsScreen.tsx on lines 122..131

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      <Typography
        variant="h6"
        style={{
          margin: "16px",
          display: "flex",
Severity: Major
Found in client-web/src/pages/Profile/MyProfile.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Profile/MyProfile.tsx on lines 91..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          <Typography
            variant="h6"
            style={{
              margin: "16px",
              display: "flex",
Severity: Major
Found in client-web/src/pages/Profile/MyProfile.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Profile/MyProfile.tsx on lines 74..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <Box sx={{ margin: 2, display: "flex", justifyContent: "center" }}>
              <Button type="submit" variant="contained">
                Register
              </Button>
            </Box>
Severity: Major
Found in client-web/src/pages/Signon/MetamaskModal.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Signon/EmailSignUpForm.tsx on lines 179..183

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function deployNfmt has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

  type: string,
  name: string,
  description: string,
  owner: string,
  beneficiaries: string[],
Severity: Major
Found in bots/createBot/src/api.ts - About 1 hr to fix

Function deployNfmt has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

  type: string,
  name: string,
  description: string,
  owner: string,
  beneficiaries: string[],
Severity: Major
Found in bots/exportToUSDC/src/api.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 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 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 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 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 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
Severity
Category
Status
Source
Language