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 routes = [
    {key: 'visibility', title: 'Visibility'},
    {key: 'profileShares', title: 'Profile Shares'},
    {key: 'documentShares', title: 'Document Shares'},
    {key: 'blocking', title: 'Blocking'},
bots/createBot/src/questions.create.ts on lines 124..133

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

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

                        <Button
                            padding={'0'}
                            width={hp('7%')}
                            height={hp('3.5%')}
                            justifyContent="center"
client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx on lines 438..445

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

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

              <Button colorScheme="danger" onPress={handleKick}>
                <Text
                  fontSize={hp('1.5%')}
                  color={'white'}
                  fontFamily={textStyles.boldFont}>
Severity: Major
Found in client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/components/Chat/ChatDetails/ChatDetailMembersList.tsx on lines 108..125

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

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

    application: {
      appCreate: TPermission;
      appPush: TPermission;
      appSettings: TPermission;
      appStats: TPermission;
Severity: Major
Found in client-web/src/http.ts and 1 other location - About 1 hr to fix
client-web/src/http.ts on lines 420..427

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

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

        <Button
          sx={{ margin: 1, textTransform: "none", fontSize: "16px" }}
          fullWidth
          variant="contained"
          color="success"
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 70..78

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

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

Consider simplifying this complex logical expression.
Open

    if (
        data.botName &&
        data.botAddress &&
        data.botPassword &&
        data.conferenceAddress &&
Severity: Critical
Found in bots/huthut/config/connect.js - About 1 hr to fix

Function renderDirections has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderDirections = (direction: string) => {
    const oppositePreviousDirection = getOpositeDirection(previousDirection);
    if (checkEmptyDirections() && direction === oppositePreviousDirection) {
      return (
        <CompassItem
Severity: Minor
Found in client-web/src/components/MetaNavigation/MetaNavigation.tsx - About 1 hr to fix

Function sendCoins has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const sendCoins = async (amount?: number) => {
    const currentCoinAmount = amount ? Number(amount) : Number(coinAmount);
    try {
      const res = await transferCoin(
        "DPT",
Severity: Minor
Found in client-web/src/components/Chat/ChatTransferDialog.tsx - About 1 hr to fix

Function onEnd has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function onEnd(
  p: Participant,
  client: Client,
  walletAddress: string
) {
Severity: Minor
Found in bots/exportToUSDC/src/questions.create.ts - About 1 hr to fix

Function roomConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  roomConfig(to: string, data: { roomName: string; roomDescription?: string }) {
    const message = xml(
      "iq",
      {
        from: this.client.jid?.toString(),
Severity: Minor
Found in client-web/src/xmpp.ts - About 1 hr to fix

Function TokensGraph has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function TokensGraph({}: Props) {
  const theme = useTheme()
  return (
    <div className="dashboard-graph" style={{ marginRight: "10px" }}>
      <a className="title" onClick={(e) => e.preventDefault()} href="/">
Severity: Minor
Found in client-web/src/pages/Dashboard/TokensGraph.tsx - About 1 hr to fix

Function roomConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const roomConfig = (
  from: string,
  to: string,
  data: {roomName: string; roomDescription: string},
  xmpp: any,
Severity: Minor
Found in client-reactnative/src/xmpp/stanzas.ts - About 1 hr to fix

Function onStopRecord has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onStopRecord = async () => {
    setRecording(false);
    animateMediaButtonOut();

    const result = await audioRecorderPlayer.stopRecorder();
Severity: Minor
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 1 hr to fix

Function renderDirections has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderDirections = (direction: string) => {
    const oppositePreviousDirection = getOpositeDirection(previousDirection);
    if (checkEmptyDirections() && direction === oppositePreviousDirection) {
      return (
        <CompassItem
Severity: Minor
Found in client-reactnative/src/components/Chat/MetaNavigation.tsx - About 1 hr to fix

Function loadTabContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const loadTabContent = () => {
    if (activeTab === 0) {
      return (
        <ProfileTabs
          activeAssetTab={activeAssetTab}
Severity: Minor
Found in client-reactnative/src/Screens/Profile/OtherUserProfileScreen.tsx - About 1 hr to fix

Function PrivacyAndDataScreen has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const PrivacyAndDataScreen = () => {
  const [routeIndex, setRouteIndex] = useState(0);

  const routes = [
    {key: 'visibility', title: 'Visibility'},
Severity: Minor
Found in client-reactnative/src/Screens/Privacy/PrivacyAndDataScreen.tsx - About 1 hr to fix

Function loadTabContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const loadTabContent = () => {
    if (activeTab === 0) {
      return (
        <ProfileTabs
          activeAssetTab={activeAssetTab}
Severity: Minor
Found in client-reactnative/src/Screens/Profile/ProfileScreen.tsx - About 1 hr to fix

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

        if (receiverData.attrs.isSystemMessage && receiverData.attrs.tokenAmount > 0 && messageCheck(message, 'bot')) {
            return sendMessage(
                handlerData,
                messages.bot.tnxForTransaction,
                'message',
Severity: Major
Found in bots/questionnaire/router.js and 1 other location - About 1 hr to fix
bots/huthut/router.js on lines 74..82

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

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

export const getUserRooms = (xmpp, botJID) => {
    xmpp.send(xml('iq', {
            type: 'get',
            from: botJID,
            id: "get_user_rooms"
Severity: Major
Found in bots/translateBot/actions.js and 2 other locations - About 1 hr to fix
bots/botTemplate/actions.js on lines 177..185
bots/raffle/actions.js on lines 177..185

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

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

export const getUserRooms = (xmpp, botJID) => {
    xmpp.send(xml('iq', {
            type: 'get',
            from: botJID,
            id: "get_user_rooms"
Severity: Major
Found in bots/botTemplate/actions.js and 2 other locations - About 1 hr to fix
bots/raffle/actions.js on lines 177..185
bots/translateBot/actions.js on lines 177..185

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

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