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 renderTabBar = (props: any) => {
  return (
    <TabBar
      renderLabel={({route, focused}) => (
        <Text
Severity: Major
Found in client-reactnative/src/Screens/Privacy/DocumentShares.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/Privacy/ProfileShare.tsx on lines 11..27

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

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

export const userData = (type, jid, data, dataGroup) => {
    let userIndex = userDatalist.findIndex(user => user.name === jid);

    if (userIndex < 0) {
        console.log('=>=> Create user data', jid);
Severity: Minor
Found in bots/merchantBot/actions.js - About 4 hrs 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 parseValue has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

const parseValue = (
  value: string,
  partTypes: PartType[],
  positionOffset = 0,
): {plainText: string; parts: Part[]} => {
Severity: Minor
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 4 hrs 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

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

  const onNetworkAclChange = (
    e: React.ChangeEvent<HTMLInputElement>,
    keyToChange: TKeys
  ) => {
    setUserAcl((prev) => ({
Severity: Major
Found in client-web/src/components/EditAcl.tsx and 1 other location - About 4 hrs to fix
client-web/src/components/EditAcl.tsx on lines 186..202

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

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 onApplicationAclChange = (
    e: React.ChangeEvent<HTMLInputElement>,
    keyToChange: TKeys
  ) => {
    setUserAcl((prev) => ({
Severity: Major
Found in client-web/src/components/EditAcl.tsx and 1 other location - About 4 hrs to fix
client-web/src/components/EditAcl.tsx on lines 203..219

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

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 (type === 'image') {
      launchImageLibrary(options, response => {
        if (response.didCancel) {
          console.log('User cancelled image picker');
        } else if (response.error) {
Severity: Major
Found in client-reactnative/src/Screens/MintScreen.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/UploadDocumentsScreen.tsx on lines 189..240

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

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 (type === 'image') {
      launchImageLibrary(options, response => {
        if (response.didCancel) {
          console.log('User cancelled image picker');
        } else if (response.error) {
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/MintScreen.tsx on lines 148..198

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

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

export const messagingTimeout = (data, timeToAdd) => {
    console.log("START TIMEOUT ", timeToAdd)
    const timeData = timeToAdd.split(":");
    const addedTime = addingTime(data, timeData);

Severity: Major
Found in bots/raffle/handlers/helpers/messagingTimeout.js - About 4 hrs to fix

Function RenderChatFooter has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RenderChatFooter = (props: RenderChatFooterProps) => {
  const boxHeight = useSharedValue(0);
  const {
    fileUploadProgress,
    setFileUploadProgress,
Severity: Major
Found in client-reactnative/src/components/Chat/RenderChatFooter.tsx - About 4 hrs to fix

ChatStore has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

export class ChatStore {
  messages: IMessage[] = [];
  xmpp: any = null;
  xmppError: any = '';
  roomList: roomListProps[] | [] = [];
Severity: Minor
Found in client-reactnative/src/stores/chatStore.ts - About 4 hrs to fix

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

          <TouchableOpacity
            disabled={loading}
            onPress={onMintClick}
            style={classes.createButton}>
            <VStack justifyContent={'center'} alignItems={'center'} flex={1}>
Severity: Major
Found in client-reactnative/src/Screens/Actions/MintScreen.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/Actions/UploadDocumentsScreen.tsx on lines 270..285

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

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
            disabled={loading}
            onPress={onMintClick}
            style={classes.createButton}>
            <VStack justifyContent={'center'} alignItems={'center'} flex={1}>
client-reactnative/src/Screens/Actions/MintScreen.tsx on lines 260..275

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

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

export const mintNft = async (contractAddress, slot, amount, walletAddress) => {
    try {
        let test = await http.post('tokens/items/nfmt/mint', {
            contractAddress: contractAddress,
            slot: slot,
Severity: Major
Found in bots/autoResponder/api.js and 5 other locations - About 4 hrs to fix
bots/botTemplate/api.js on lines 89..108
bots/gptBot/api.js on lines 90..109
bots/merchantBot/api.js on lines 90..109
bots/raffle/api.js on lines 124..143
bots/translateBot/api.js on lines 89..108

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

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

export const mintNft = async (contractAddress, slot, amount, walletAddress) => {
    try {
        let test = await http.post('tokens/items/nfmt/mint', {
            contractAddress: contractAddress,
            slot: slot,
Severity: Major
Found in bots/merchantBot/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 90..109
bots/botTemplate/api.js on lines 89..108
bots/gptBot/api.js on lines 90..109
bots/raffle/api.js on lines 124..143
bots/translateBot/api.js on lines 89..108

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

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

export const mintNft = async (contractAddress, slot, amount, walletAddress) => {
    try {
        let test = await http.post('tokens/items/nfmt/mint', {
            contractAddress: contractAddress,
            slot: slot,
Severity: Major
Found in bots/gptBot/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 90..109
bots/botTemplate/api.js on lines 89..108
bots/merchantBot/api.js on lines 90..109
bots/raffle/api.js on lines 124..143
bots/translateBot/api.js on lines 89..108

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

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

export const mintNft = async (contractAddress, slot, amount, walletAddress) => {
    try {
        let test = await http.post('tokens/items/nfmt/mint', {
            contractAddress: contractAddress,
            slot: slot,
Severity: Major
Found in bots/translateBot/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 90..109
bots/botTemplate/api.js on lines 89..108
bots/gptBot/api.js on lines 90..109
bots/merchantBot/api.js on lines 90..109
bots/raffle/api.js on lines 124..143

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

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

export const mintNft = async (contractAddress, slot, amount, walletAddress) => {
    try {
        let test = await http.post('tokens/items/nfmt/mint', {
            contractAddress: contractAddress,
            slot: slot,
Severity: Major
Found in bots/raffle/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 90..109
bots/botTemplate/api.js on lines 89..108
bots/gptBot/api.js on lines 90..109
bots/merchantBot/api.js on lines 90..109
bots/translateBot/api.js on lines 89..108

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

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

export const mintNft = async (contractAddress, slot, amount, walletAddress) => {
    try {
        let test = await http.post('tokens/items/nfmt/mint', {
            contractAddress: contractAddress,
            slot: slot,
Severity: Major
Found in bots/botTemplate/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 90..109
bots/gptBot/api.js on lines 90..109
bots/merchantBot/api.js on lines 90..109
bots/raffle/api.js on lines 124..143
bots/translateBot/api.js on lines 89..108

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

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

export default function ChatDetails() {
  const { roomJID } = useParams<{ roomJID: string }>();

  const [newDescription, setNewDescription] = useState("");
  const [newRoomName, setNewRoomName] = useState("");
Severity: Major
Found in client-web/src/pages/ChatRoomDetails/ChatDetailCard.tsx - About 4 hrs to fix

Function UsernameSignInForm has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function UsernameSignInForm(props: TProps) {
  const setUser = useStoreState((state) => state.setUser);
  const history = useHistory();
  const formik = useFormik({
    initialValues: {
Severity: Major
Found in client-web/src/pages/Signon/UsernameSignInForm.tsx - About 4 hrs to fix
Severity
Category
Status
Source
Language