dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

                <NativeSelect
                  inputProps={{
                    name: "appName",
                    id: "uncontrolled-native",
                  }}
Severity: Major
Found in client-web/src/pages/Owner/NewUserModal.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Owner/Users.tsx on lines 165..179

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 64.

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

            <Select
              labelId="demo-simple-select-label"
              id="demo-simple-select"
              label="App"
              value={currentApp}
Severity: Major
Found in client-web/src/pages/Owner/Users.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Owner/NewUserModal.tsx on lines 125..141

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 64.

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 RoomList has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const RoomList:React.FC<IRoomList> = observer((props:IRoomList) => {
  const {chatStore} = useStores();
  const {roomsList} = props;
  const sortedRoomsList = roomsList.sort(
    (a: any, b: any) =>
Severity: Minor
Found in client-reactnative/src/components/RoomList/RoomList.tsx - About 1 hr to fix

Function EmailListItem has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const EmailListItem = (props: EmailListItemProps) => {
  const {emailList, tooltipVisible, setTooltipVisible, deleteEmail} = props;

  const {email, verified} = emailList.item;
  const index = emailList.index;
Severity: Minor
Found in client-reactnative/src/components/Account/EmailListItem.tsx - About 1 hr to fix

Function router has a Cognitive Complexity of 12 (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/autoResponder/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 Routes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const Routes = () => {
  const userId = useStoreState((state) => state.user._id);
  const user = useStoreState((state) => state.user);

  const setACL = useStoreState((state) => state.setACL);
Severity: Minor
Found in client-web/src/pages/Routes.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 MainHeader has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const MainHeader = observer(() => {
  const {chatStore, apiStore, loginStore} = useStores();
  const navigation = useNavigation<HomeStackNavigationProp>();
  const route = useRoute();
  const buttons = [
Severity: Minor
Found in client-reactnative/src/components/MainHeader/MainHeader.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 ChatDetailHeader has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const ChatDetailHeader: React.FunctionComponent<ChatDetailHeaderProps> = (
  props: ChatDetailHeaderProps,
) => {
  //component props
  const {deleteRoomDialog, toggleFavourite, currentRoomDetail} = props;

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 NewChatScreen has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const NewChatScreen = (props: NewChatScreenProps) => {
  const [chatAvatar, setChatAvatar] = useState();
  const [chatName, setChatName] = useState('');
  const [chatDescription, setChatDescription] = useState('');
  const [loading, setLoading] = useState(false);
Severity: Minor
Found in client-reactnative/src/Screens/Chat/NewChatScreen.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 messages has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function BlackListUserItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function BlackListUserItem(props: BlackListUserItemProps) {
  const { userItem, handleRemove } = props;

  return (
    <Box
Severity: Minor
Found in client-web/src/pages/Privacy/Blocking.tsx - About 1 hr to fix

Function sendAttachment has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const sendAttachment = async (
    userToken: string,
    roomDetail: roomListProps,
  ) => {
    const xmpp = chatStore.xmpp;
Severity: Minor
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 1 hr to fix

Function handleFaceBookLogin has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const handleFaceBookLogin = async (
  defaultToken: string,
  loginUser: any,
  registerSocialUser: any,
  type: string,
Severity: Minor
Found in client-reactnative/src/helpers/login/socialLoginHandle.ts - About 1 hr to fix

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

package com.ethora; // (1)

import com.wix.detox.Detox;
import com.wix.detox.config.DetoxConfig;

client-reactnative/android/app/src/androidTest/java/com/ethora/DetoxTest.java on lines 1..29

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 94.

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

package com.ethora; // (1)

import com.wix.detox.Detox;
import com.wix.detox.config.DetoxConfig;

client-reactnative/android/app/src/androidTest/DetoxTest.java on lines 1..29

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 94.

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 3 locations. Consider refactoring.
Open

  const {
    fileUploadProgress,
    setFileUploadProgress,
    allowIsTyping,
    isTyping,
client-reactnative/src/components/Modals/Profile/ProfileModal.tsx on lines 33..45
client-reactnative/src/components/Transactions/NftListItem.tsx on lines 82..94

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 63.

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

                  <FastImage
                    style={styles.tokenImage}
                    source={{
                      uri: filePreview?.uri,
                      priority: FastImage.priority.normal,
client-reactnative/src/Screens/Profile/NftItemHistoryScreen.tsx on lines 164..171

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 63.

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

      if (stanza.attrs.id === XMPP_TYPES.setRoomBackgroundImage) {
        console.log(
          stanza.children[0].attrs,
          stanza.children[0].children,
          stanza,
Severity: Major
Found in client-reactnative/src/stores/chatStore.ts and 1 other location - About 1 hr to fix
client-reactnative/src/stores/chatStore.ts on lines 763..771

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 63.

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

        {regularLoginUsername && (
          <Button
            sx={{ margin: 1, textTransform: "none", fontSize: "16px" }}
            fullWidth
            variant="contained"
Severity: Major
Found in client-web/src/pages/Signon/RegularSignIn.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Signon/RegularSignIn.tsx on lines 40..49

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 63.

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 3 locations. Consider refactoring.
Open

  const {
    assetUrl,
    assetsYouHave,
    totalAssets,
    name,
client-reactnative/src/components/Chat/RenderChatFooter.tsx on lines 43..55
client-reactnative/src/components/Modals/Profile/ProfileModal.tsx on lines 33..45

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 63.

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

Severity
Category
Status
Source
Language