dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

export function registerByEmail(
  email: string,
  password: string,
  firstName: string,
  lastName: 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 443..459

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

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

          <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>
            <span style={{ fontWeight: "bold" }}>Timestamp:</span>{" "}
            {format(new Date(item.timestamp), "pp PP")}
          </ListItem>
Severity: Major
Found in client-web/src/pages/Transactions/Transactions.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Transactions/Provenance.tsx on lines 164..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 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

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

Function ThreadContainer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const ThreadContainer: React.FC<ThreadContainerProps> = ({
  roomData,
  handleSetThreadView,
  isThreadView,
  profile,
Severity: Minor
Found in client-web/src/components/Chat/Threads/ThreadContainer.tsx - About 2 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 EditProfileModal has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export default function EditProfileModal({ open, setOpen, user }: TProps) {
  const [change, setChange] = useState(false);
  const [loading, setLoading] = useState(false);
  const setUser = useStoreState((state) => state.setUser);

Severity: Minor
Found in client-web/src/pages/Profile/EditProfileModal.tsx - About 2 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 RegisterScreen has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const RegisterScreen = ({navigation}: RegisterScreenProps) => {
  const [password, setPassword] = useState('');
  const [username, setUsername] = useState('');
  const [passwordCheck, setPasswordCheck] = useState('');
  const [firstname, setFirstname] = useState('');
Severity: Minor
Found in client-reactnative/src/Screens/Login/RegisterScreen.tsx - About 2 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 handleSendMessage has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const handleSendMessage = (message: IMessage[]) => {
    const messageText = message[0].text;
    const tokenAmount = message[0].tokenAmount || 0;
    const receiverMessageId = message[0].receiverMessageId || 0;
    const data = {
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 2 hrs to fix

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

                <View width={'90%'} justifyContent={'flex-end'}>
                  <HStack>
                    <Text fontFamily={textStyles.semiBoldFont}>Open </Text>
                    <Text>(default)</Text>
                  </HStack>
Severity: Major
Found in client-reactnative/src/Screens/Privacy/Visibility.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Privacy/Visibility.tsx on lines 146..154

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

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 width={'90%'}>
                  <HStack>
                    <Text fontFamily={textStyles.semiBoldFont}>Full </Text>
                    <Text>(default)</Text>
                  </HStack>
Severity: Major
Found in client-reactnative/src/Screens/Privacy/Visibility.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Privacy/Visibility.tsx on lines 92..101

Duplicated Code

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

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

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

Tuning

This issue has a mass of 76.

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

const router = (handlerData) => {
    const roomMuteIndex = muteRoomList.indexOf(handlerData.roomJID)

    if(roomMuteIndex > -1){
        if (messageCheck(handlerData.message, 'start translate') ||
Severity: Major
Found in bots/translateBot/router.js - About 2 hrs to fix

Function router has 51 lines of code (exceeds 25 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: Major
Found in bots/autoResponder/router.js - About 2 hrs to fix

Function QRSection has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const QRSection = (props: QRSectionProps) => {
    const {
        user,
        createdLink,
        linkType
Severity: Major
Found in client-web/src/pages/Privacy/QRSection.tsx - About 2 hrs to fix

Function setChatAvatar has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const setChatAvatar = async (type: string) => {
    if (type === 'image') {
      launchImageLibrary(options, response => {
        if (response.didCancel) {
          console.log('User cancelled image picker');
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

    if (
        !process.env.TYPE ||
        !process.env.BOT_ADDRESS ||
        !process.env.CONFERENCE_ADDRESS ||
        !process.env.APP_USERNAME ||
Severity: Critical
Found in bots/translateBot/config/connect.js - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

    if (
        !process.env.TYPE ||
        !process.env.BOT_ADDRESS ||
        !process.env.CONFERENCE_ADDRESS ||
        !process.env.APP_USERNAME ||
Severity: Critical
Found in bots/raffle/config/connect.js - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

    if (
        !process.env.TYPE ||
        !process.env.BOT_ADDRESS ||
        !process.env.CONFERENCE_ADDRESS ||
        !process.env.APP_USERNAME ||
Severity: Critical
Found in bots/botTemplate/config/connect.js - About 2 hrs to fix

Function Explorer has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function Explorer() {
  const user = useStoreState((store) => store.user);
  const [transactions, setTransactions] = useState<
    ExplorerRespose<ITransaction[]>
  >({
Severity: Minor
Found in client-web/src/pages/Explorer/Explorer.tsx - About 2 hrs to fix

Function setChatAvatar has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const setChatAvatar = async (type: string) => {
    if (type === 'image') {
      launchImageLibrary(options, response => {
        if (response.didCancel) {
          console.log('User cancelled image picker');
Severity: Minor
Found in client-reactnative/src/Screens/MintScreen.tsx - About 2 hrs to fix

Function onSuccess has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onSuccess = (e: any) => {
    if (!e) {
      showToast('error', 'Error', 'Invalid QR', 'top');
      setIsLoading(false);
      return;
Severity: Minor
Found in client-reactnative/src/Screens/Actions/ScanScreen.tsx - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

    if (
      item.tokenType === 'NFMT' &&
      item.balances &&
      item.contractTokenIds &&
      item.maxSupplies &&
Severity: Critical
Found in client-reactnative/src/stores/walletStore.ts - About 2 hrs to fix
Severity
Category
Status
Source
Language