dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

          <View style={classes.section1}>
            <TextInput
              value={itemName}
              onChangeText={setItemName}
              placeholder="Document Name"
client-reactnative/src/Screens/UploadDocumentsScreen.tsx on lines 255..264

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

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

          {!!item.fromFirstName && (
            <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>
              <span style={{ fontWeight: "bold" }}>Sender First Name:</span>
              {item.fromFirstName}
            </ListItem>
Severity: Major
Found in client-web/src/pages/Transactions/Provenance.tsx and 7 other locations - About 2 hrs to fix
client-web/src/pages/Transactions/Provenance.tsx on lines 157..162
client-web/src/pages/Transactions/Provenance.tsx on lines 169..174
client-web/src/pages/Transactions/Provenance.tsx on lines 175..180
client-web/src/pages/Transactions/Provenance.tsx on lines 181..186
client-web/src/pages/Transactions/Provenance.tsx on lines 187..192
client-web/src/pages/Transactions/Provenance.tsx on lines 193..198
client-web/src/pages/Transactions/Provenance.tsx on lines 199..204

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

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

          {!!item.fromLastName && (
            <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>
              <span style={{ fontWeight: "bold" }}>Sender Last Name:</span>
              {item.fromLastName}
            </ListItem>
Severity: Major
Found in client-web/src/pages/Transactions/Provenance.tsx and 7 other locations - About 2 hrs to fix
client-web/src/pages/Transactions/Provenance.tsx on lines 151..156
client-web/src/pages/Transactions/Provenance.tsx on lines 169..174
client-web/src/pages/Transactions/Provenance.tsx on lines 175..180
client-web/src/pages/Transactions/Provenance.tsx on lines 181..186
client-web/src/pages/Transactions/Provenance.tsx on lines 187..192
client-web/src/pages/Transactions/Provenance.tsx on lines 193..198
client-web/src/pages/Transactions/Provenance.tsx on lines 199..204

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

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

          <View style={classes.section1}>
            <TextInput
              value={itemName}
              onChangeText={setItemName}
              placeholder="Document Name"
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Actions/UploadDocumentsScreen.tsx on lines 196..205

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

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

          {!!item.toLastName && (
            <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>
              <span style={{ fontWeight: "bold" }}>Receiver Last Name:</span>
              {item.toLastName}
            </ListItem>
Severity: Major
Found in client-web/src/pages/Transactions/Provenance.tsx and 7 other locations - About 2 hrs to fix
client-web/src/pages/Transactions/Provenance.tsx on lines 151..156
client-web/src/pages/Transactions/Provenance.tsx on lines 157..162
client-web/src/pages/Transactions/Provenance.tsx on lines 169..174
client-web/src/pages/Transactions/Provenance.tsx on lines 181..186
client-web/src/pages/Transactions/Provenance.tsx on lines 187..192
client-web/src/pages/Transactions/Provenance.tsx on lines 193..198
client-web/src/pages/Transactions/Provenance.tsx on lines 199..204

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

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

          {!!item.tokenName && (
            <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>
              <span style={{ fontWeight: "bold" }}>Token Name:</span>
              {item.tokenName}
            </ListItem>
Severity: Major
Found in client-web/src/pages/Transactions/Provenance.tsx and 7 other locations - About 2 hrs to fix
client-web/src/pages/Transactions/Provenance.tsx on lines 151..156
client-web/src/pages/Transactions/Provenance.tsx on lines 157..162
client-web/src/pages/Transactions/Provenance.tsx on lines 169..174
client-web/src/pages/Transactions/Provenance.tsx on lines 175..180
client-web/src/pages/Transactions/Provenance.tsx on lines 187..192
client-web/src/pages/Transactions/Provenance.tsx on lines 193..198
client-web/src/pages/Transactions/Provenance.tsx on lines 199..204

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

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>
                <Typography
                fontWeight={"bold"}
                >Create a Profile Sharing link</Typography>
                <Typography>
Severity: Major
Found in client-web/src/pages/Privacy/AddProfileTabPanel.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Privacy/AddDocumentTabPanel.tsx on lines 81..97

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

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>
                <Typography
                fontWeight={"bold"}
                >Create a Document Sharing link</Typography>
                <Typography>
Severity: Major
Found in client-web/src/pages/Privacy/AddDocumentTabPanel.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Privacy/AddProfileTabPanel.tsx on lines 150..166

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

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

  const handleCreateNewChat = () => {
    let roomHash = '';
    sha256(chatName).then(async hash => {
      roomHash = hash;

Severity: Major
Found in client-reactnative/src/Screens/Chat/NewChatScreen.tsx - About 2 hrs to fix

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

test("renders correctly", ()=>{
 
   const tree = renderer.create(
    <PlayButton
    onPress={()=>console.log("play pressed")}
Severity: Major
Found in client-reactnative/__tests__/AudioPlayer/PlayButton-test.tsx and 1 other location - About 2 hrs to fix
client-reactnative/__tests__/Modals/TransactionModal/ReportAndBlockButton-test.tsx on lines 5..15

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

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 (
        item.participants > 2 &&
        !isDefaultChat &&
        !this.roomsInfoMap[item.jid]?.isFavourite
      ) {
Severity: Major
Found in client-reactnative/src/stores/chatStore.ts and 1 other location - About 2 hrs to fix
client-reactnative/src/stores/chatStore.ts on lines 449..456

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

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 (
        item.participants < 3 &&
        !isDefaultChat &&
        !this.roomsInfoMap[item.jid]?.isFavourite
      ) {
Severity: Major
Found in client-reactnative/src/stores/chatStore.ts and 1 other location - About 2 hrs to fix
client-reactnative/src/stores/chatStore.ts on lines 463..470

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

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

test("renders correctly", ()=>{
 
   const tree = renderer.create(
   <ReportAndBlockButton
   onPress={() => console.log("press")}
client-reactnative/__tests__/AudioPlayer/PlayButton-test.tsx on lines 5..15

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

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

export const answerHandler = (data) => {
    console.log('=> answerHandler | Message received from ', data.receiver, data.message);
    const userMessage = data.message.split(' ').slice(1).join(' ');
    getListAnswers(data.receiver).then(result => {
        const answerId = result.length+1;
Severity: Major
Found in bots/questionnaire/handlers/answer.js - About 2 hrs to fix

Function ManageDocumentShareTabPanel has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ManageDocumentShareTabPanel = (
  props: ManageDocumentShareTabPanelProps
) => {
  const { handleChangeTab, loading, sharedLinks, handleOpenModal, deleteLink } =
    props;
Severity: Major
Found in client-web/src/pages/Privacy/ManageDocumentShareTabPanel.tsx - About 2 hrs to fix

Function sendFile has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const sendFile = async (file: File, isReply: boolean) => {
    const formData = new FormData();
    formData.append("files", file);
    setFileUploading(true);
    try {
Severity: Major
Found in client-web/src/pages/ChatInRoom/Chat.tsx - About 2 hrs to fix

Function RenderMainMessageSection has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const RenderMainMessageSection: React.FC = () => {
    const firstName = currentThreadMessage?.user.name.split(' ')[0] || 'N/A';
    const lastName = currentThreadMessage?.user.name.split(' ')[1] || 'N/A';
    //@ts-ignore
    const parentDate = new Date(currentThreadMessage?.createdAt * 1000);
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 2 hrs to fix

Function AddNewEmailModal has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AddNewEmailModal = (props: AddNewEmailModalProps) => {
  const {
    setNewEmail,
    submitEmail,
    loading,
Severity: Major
Found in client-reactnative/src/components/Modals/Account/AddNewEmail.tsx - About 2 hrs to fix

Function RenderCoin has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RenderCoin = (props: RenderCoinProps) => {
  const {tokenSymbol, tokenName, balance, index} = props;
  return (
    <View
      style={{
Severity: Major
Found in client-reactnative/src/components/Transactions/RenderCoin.tsx - About 2 hrs to fix

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

export function registerSocial(
  idToken: string,
  accessToken: string,
  authToken: string,
  loginType: string
Severity: Major
Found in client-web/src/http.ts and 1 other location - About 2 hrs to fix
client-web/src/http.ts on lines 347..363

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

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