dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

        const res = await DocumentPicker.pick({
          type: [
            DocumentPicker.types.images,
            DocumentPicker.types.audio,
            DocumentPicker.types.video,
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 160..167

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

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

        <View>
          <Text style={styles.title}>Download your data</Text>

          <Text style={styles.description}>
            You own your data. Tap the button below to download a copy of your
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ManageData.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/Account/Authentication.tsx on lines 203..210

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

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

              {chatAvatar ? (
                <FastImage
                  source={{uri: chatAvatar}}
                  style={{
                    width: wp('15%'),
Severity: Major
Found in client-reactnative/src/Screens/Chat/NewChatScreen.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/Account/AccountScreen.tsx on lines 130..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 60.

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

        <View>
          <Text style={styles.title}>Mainnet address</Text>
          <Text style={styles.description}>
            (Optional) confirm your L1 (Ethereum Mainnet) wallet address here if
            you need to export your assets to Mainnet or carry out other L1
Severity: Major
Found in client-reactnative/src/Screens/Account/Authentication.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/Privacy/ManageData.tsx on lines 70..77

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

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 {data} = await httpPost(shareLink, body, loginStore.userToken);
      setCreatedLink(data.sharelinkData);
    } catch (error) {
      console.log(error);
Severity: Major
Found in client-reactnative/src/Screens/Privacy/DocumentShareAdd.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx on lines 57..62

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

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 {data} = await httpPost(shareLink, body, loginStore.userToken);
      setCreatedLink(data.sharelinkData);
    } catch (error) {
      console.log(error);
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/Privacy/DocumentShareAdd.tsx on lines 69..74

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

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

Method getJSIModulePackage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  @Override
  protected JSIModulePackage getJSIModulePackage() {
    return new JSIModulePackage() {
      @Override
      public List<JSIModuleSpec> getJSIModules(

Function Subscription has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Subscription({}: Props) {
  const [open, setOpen] = React.useState(false);
  const user = useStoreState((state) => state.user);
  const dptBalance = useStoreState((state) =>
    state.balance.find((el) => el.tokenName === "Dappros Platform Token")
Severity: Minor
Found in client-web/src/components/Subscription.tsx - About 1 hr to fix

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

    onSubmit: async (values) => {
      const signer = library.getSigner();
      try {
        const msg = "Register";
        const signature = await signer.signMessage(msg);
Severity: Minor
Found in client-web/src/pages/Signon/MetamaskModal.tsx - About 1 hr to fix

Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function registerValidSW(swUrl: string, config?: Config) {
  navigator.serviceWorker
    .register(swUrl)
    .then((registration) => {
      registration.onupdatefound = () => {
Severity: Minor
Found in client-web/src/serviceWorkerRegistration.ts - About 1 hr to fix

Function onCropComplete has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function onCropComplete(crop) {
    const canvas = document.createElement("canvas");
    const pixelRatio = window.devicePixelRatio;
    const scaleX = imgRef.current.naturalWidth / imgRef.current.width;
    const scaleY = imgRef.current.naturalHeight / imgRef.current.height;
Severity: Minor
Found in client-web/src/pages/Profile/ChangeImage.tsx - About 1 hr to fix

Function ChangeRoomNameModal has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ChangeRoomNameModal = (props: ChangeRoomNameModalProps) => {
  const {modalVisible, setModalVisible, currentRoomName, changeRoomName} =
    props;

  const [newRoomName, setNewRoomName] = React.useState<string>(currentRoomName);

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

  const submitMediaMessage = (props: any, waveForm?: any) => {
    props.map(async (item: any) => {
      const data = {
        firstName,
        lastName,
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 1 hr to fix

Function deleteItem has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const deleteItem = async () => {
    setLoading(true);
    try {
      if (item?.isCollection) {
        await httpPost(
Severity: Minor
Found in client-reactnative/src/Screens/Profile/NftItemHistoryScreen.tsx - About 1 hr to fix

Function addNewItemHandler has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const addNewItemHandler = (data) => {
    console.log('=> addNewItemHandler || Message received from ', data.receiver, data.message);
    let currentButtonType = userData('getData', data.userJID, null, 'buttonType');

    setAnswer(0, data.message, data.userJID, currentButtonType).then(() => {
Severity: Minor
Found in bots/merchantBot/handlers/addNewItem.js - About 1 hr to fix

Function openPrivateRoom has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const openPrivateRoom = () => {
    createPrivateChat(
      user.walletAddress,
      message.data.senderWalletAddress,
      user.firstName,
Severity: Minor
Found in client-web/src/components/Chat/ChatTransferDialog.tsx - About 1 hr to fix

Function handleSendMessage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const handleSendMessage = (messageString: any) => {
    if (isEditing) {
      const messageText = messageString[0].text;
      const tokenAmount = messageString[0].tokenAmount || 0;
      const receiverMessageId = messageString[0].receiverMessageId || 0;
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 1 hr to fix

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

        <TextInput
          value={searchText}
          onChangeText={text => setSearchText(text)}
          placeholder="Search"
          placeholderTextColor={'black'}
Severity: Major
Found in client-reactnative/src/Screens/System/DebugScreen.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/System/DebugScreen.tsx on lines 115..122

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

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
          w={hp('3.5%')}
          h={hp('3.5%')}
          rounded={'full'}
          bg={commonColors.primaryColor}
client-reactnative/src/components/Transactions/TransactionsListItem.tsx on lines 64..77

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

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

            <TouchableOpacity onPress={() => setModalVisible(true)}>
              <AntIcon
                // onPress={() => props.navigation.navigate('LoginComponent')}
                color={commonColors.primaryColor}
                name="caretdown"
Severity: Major
Found in client-reactnative/src/Screens/System/DebugScreen.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/Screens/MintScreen.tsx on lines 315..325

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

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