bastienrobert/la-ferme

View on GitHub

Showing 178 of 214 total issues

Function setCardRound has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    async setCardRound(_, { playerUUID, choice, targets }) {
      const { game, player, players, lastRound } = await getPlayerData(
        playerUUID
      )

Severity: Minor
Found in packages/server/app/graphql/resolvers/round.ts - About 1 hr to fix

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

          <TopContainer alignSelf="center">
            <TitleWithHashtag
              anchor="right"
              titleColor="beige"
              hashtagColor="yellow"
    Severity: Major
    Found in packages/mobile/src/pages/Onboarding/Pending/index.tsx and 1 other location - About 1 hr to fix
    packages/mobile/src/pages/samples/Pending.tsx on lines 23..31

    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

            <Container alignSelf="center">
              <TitleWithHashtag
                anchor="right"
                titleColor="beige"
                hashtagColor="yellow"
    Severity: Major
    Found in packages/mobile/src/pages/samples/Pending.tsx and 1 other location - About 1 hr to fix
    packages/mobile/src/pages/Onboarding/Pending/index.tsx on lines 84..92

    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

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

        webpack(config, options) {
          const { isServer } = options;
          nextConfig = Object.assign({ inlineImageLimit: 8192, assetPrefix: "" }, nextConfig);
    
          if (!options.defaultLoaders) {
    Severity: Minor
    Found in packages/website/scripts/withFiles.js - About 1 hr to fix

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

            Animated.timing(translateLine, {
              toValue: { x: 0, y: 0 },
              duration: 600,
              easing: Easing.out(Easing.exp),
              useNativeDriver: true
      Severity: Major
      Found in packages/mobile/src/components/shared/PlayersReady.tsx and 1 other location - About 1 hr to fix
      packages/mobile/src/components/shared/NotificationBanner.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 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

          Animated.timing(translateLarge, {
            toValue: { x: 0, y: 0 },
            duration: 600,
            easing: Easing.out(Easing.exp),
            useNativeDriver: true
      packages/mobile/src/components/shared/PlayersReady.tsx on lines 32..40

      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

      Function AlertContainer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Confirmed

      const AlertContainer: FC = () => {
        const [alerts, setAlert] = useState<IdentifiedAlert[]>([])
      
        useBus(
          'alert',
      Severity: Minor
      Found in packages/mobile/src/App/Alert/AlertContainer.tsx - About 1 hr to fix

        Function readyForRound has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async readyForRound(_, { playerUUID }) {
              const player = await Player.findByUUID(playerUUID, {
                withRelated: [
                  'user',
                  'game',
        Severity: Minor
        Found in packages/server/app/graphql/resolvers/round.ts - About 1 hr to fix

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

                <TextContainer alignSelf="center">
                  <StyledText textAlign="center">
                    Musique à fond vous n'entendez même pas le joueur qui manque de vous
                    donner un coup de boule.
                  </StyledText>
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillContent.tsx on lines 73..81

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

          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

          interface ComponentRef {
            wrapperValue: Animated.Value
            overlayValue: Animated.Value
            wrapperAnimation: Animated.CompositeAnimation
            overlayAnimation: Animated.CompositeAnimation
          Severity: Major
          Found in packages/mobile/src/pages/samples/Game/Round/Transition.tsx and 1 other location - About 1 hr to fix
          packages/mobile/src/components/shared/AnimatedTitle.tsx on lines 26..31

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

          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

                <TextContainer alignSelf="center">
                  <StyledText textAlign="center">
                    Vous avez une faim de loup, c'est l'heure de rassasier votre appetit.
                    Au menu ?Un gros Big Meuh.
                  </StyledText>
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillConfirm.tsx on lines 17..26

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

          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

          interface AnimatedTitleRef {
            opacity: Animated.Value
            translate: Animated.ValueXY
            rotate: Animated.Value
            scale: Animated.Value
          Severity: Major
          Found in packages/mobile/src/components/shared/AnimatedTitle.tsx and 1 other location - About 1 hr to fix
          packages/mobile/src/pages/samples/Game/Round/Transition.tsx on lines 31..36

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

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

                    <ButtonContainer alignSelf="center">
                      <Button onPress={onConfirm}>YEP</Button>
                      <Button onPress={onCancel}>NOPE</Button>
                    </ButtonContainer>
          packages/mobile/src/pages/samples/Game/Popup/GameOver/index.tsx on lines 42..45
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillActions.tsx on lines 42..45
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillContent.tsx on lines 63..66

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

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

                  <ButtonContainer alignSelf="center">
                    <Button onPress={onConfirmPress}>YEP</Button>
                    <Button onPress={onCancelPress}>NOPE</Button>
                  </ButtonContainer>
          packages/mobile/src/pages/samples/Game/Popup/GameOver/index.tsx on lines 42..45
          packages/mobile/src/pages/samples/Game/Popup/Report/index.tsx on lines 40..43
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillContent.tsx on lines 63..66

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

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

                  <ButtonContainer alignSelf="center">
                    <Button onPress={onConfirm}>YEP</Button>
                    <Button onPress={onCancel}>NOPE</Button>
                  </ButtonContainer>
          packages/mobile/src/pages/samples/Game/Popup/Report/index.tsx on lines 40..43
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillActions.tsx on lines 42..45
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillContent.tsx on lines 63..66

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

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

                  <ButtonContainer alignSelf="center">
                    <Button onPress={onConfirmPress}>YEP</Button>
                    <Button onPress={onResetPress}>NOPE</Button>
                  </ButtonContainer>
          packages/mobile/src/pages/samples/Game/Popup/GameOver/index.tsx on lines 42..45
          packages/mobile/src/pages/samples/Game/Popup/Report/index.tsx on lines 40..43
          packages/mobile/src/pages/samples/Game/Popup/Skill/SkillActions.tsx on lines 42..45

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

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

          const ResourceSavingScene: FC<Props> = props => {
            // react-native-screens is buggy on web
            if (screensEnabled?.() && Platform.OS !== 'web') {
              const { isVisible, ...rest } = props
          
          

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

          const editLastRoundTarget = async (skill: Skill) => {
            // get player with related targets and rounds
            const player = await skill.player().fetch({
              withRelated: [
                {
          Severity: Minor
          Found in packages/server/app/engine/getActionBySkill.ts - About 1 hr to fix

            Function onPanResponderRelease has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Confirmed

                  onPanResponderRelease: (_, gestureState) => {
                    if (answer) return
                    if (
                      gestureState.dx + COMPONENT_HEIGHT + RELEASE_OFFSET >
                      layout.current.width
            Severity: Minor
            Found in packages/mobile/src/components/shared/SlideToAnswer.tsx - About 1 hr to fix

              Function stopGame has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async stopGame(_, { winnerUUID }) {
                    const winner = await Player.findByUUID(winnerUUID, {
                      withRelated: ['game', 'game.room', 'game.players', 'game.players.user']
                    })
                    const game = winner.related('game') as Game
              Severity: Minor
              Found in packages/server/app/graphql/resolvers/game.ts - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language