bastienrobert/la-ferme

View on GitHub

Showing 178 of 214 total issues

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

  {
    name: 'bullying',
    displayName: 'Harcélement',
    playerText:
      "Un chaud lapin s'approche près de vous et vous siffle. Vous décidez d'appeler à l'aide.",
Severity: Major
Found in packages/shared/data/cards/uncivil.ts and 3 other locations - About 1 hr to fix
packages/shared/data/cards/uncivil.ts on lines 23..40
packages/shared/data/cards/uncivil.ts on lines 60..77
packages/shared/data/cards/uncivil.ts on lines 116..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 70.

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

  {
    name: 'stinky-mattress',
    displayName: 'Matelas puant',
    playerText:
      "Un matelas pourri encombre l'ascenseur. Vous devez prendre l'escalier.",
Severity: Major
Found in packages/shared/data/cards/uncivil.ts and 3 other locations - About 1 hr to fix
packages/shared/data/cards/uncivil.ts on lines 23..40
packages/shared/data/cards/uncivil.ts on lines 60..77
packages/shared/data/cards/uncivil.ts on lines 191..208

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

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 PosterSlice has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

const PosterSlice: FC = () => {
  const container = useRef()
  const wrapper = useRef()

  const draggable = useDraggable(wrapper, {
Severity: Minor
Found in packages/website/src/components/slices/PosterSlice/index.tsx - About 1 hr to fix

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

            <ButtonContainer alignSelf="center">
              <Button onPress={onConfirm}>{content.cta_yes}</Button>
              <Button onPress={onCancel}>{content.cta_no}</Button>
            </ButtonContainer>
    packages/mobile/src/pages/Game/Main/Popup/Report/index.tsx on lines 80..83
    packages/mobile/src/pages/Game/Main/Popup/Skill/SkillActions.tsx on lines 45..48
    packages/mobile/src/pages/Game/Main/Popup/Skill/SkillRequest/SkillContent.tsx on lines 74..77

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

    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

          <StyledTitleWithHashtag
            title={data.displayName}
            titleColor="gray"
            hashtag={[data.description]}
            hashtagColor="yellow"
    packages/mobile/src/pages/Game/Main/MiniGame/MiniGameGoStop.tsx on lines 52..60

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

    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

            <StyledTitleWithHashtag
              title={global.title}
              titleColor="beige"
              hashtag={[global.description]}
              hashtagColor="yellow"
    packages/mobile/src/pages/Game/Main/Popup/Skill/SkillHeader.tsx on lines 17..25

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

    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}>{content.cta_yes}</Button>
              <Button onPress={onResetPress}>{content.cta_no}</Button>
            </ButtonContainer>
    packages/mobile/src/pages/Game/Main/Popup/GameOver/index.tsx on lines 52..55
    packages/mobile/src/pages/Game/Main/Popup/Report/index.tsx on lines 80..83
    packages/mobile/src/pages/Game/Main/Popup/Skill/SkillActions.tsx on lines 45..48

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

    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}>{content.cta_yes}</Button>
              <Button onPress={onCancelPress}>{content.cta_no}</Button>
            </ButtonContainer>
    packages/mobile/src/pages/Game/Main/Popup/GameOver/index.tsx on lines 52..55
    packages/mobile/src/pages/Game/Main/Popup/Report/index.tsx on lines 80..83
    packages/mobile/src/pages/Game/Main/Popup/Skill/SkillRequest/SkillContent.tsx on lines 74..77

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

    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}>{content.cta_yes}</Button>
                <Button onPress={onCancel}>{content.cta_no}</Button>
              </ButtonContainer>
    Severity: Major
    Found in packages/mobile/src/pages/Game/Main/Popup/Report/index.tsx and 3 other locations - About 1 hr to fix
    packages/mobile/src/pages/Game/Main/Popup/GameOver/index.tsx on lines 52..55
    packages/mobile/src/pages/Game/Main/Popup/Skill/SkillActions.tsx on lines 45..48
    packages/mobile/src/pages/Game/Main/Popup/Skill/SkillRequest/SkillContent.tsx on lines 74..77

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

    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 panResponder has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

      const panResponder = useMemo(() => {
        return PanResponder.create({
          onStartShouldSetPanResponder: () => true,
          onPanResponderMove: (evt, gestureState) => {
            if (
    Severity: Minor
    Found in packages/mobile/src/components/shared/SlideToAnswer.tsx - About 1 hr to fix

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

              <Container alignSelf="center">
                <Title preset="H1" color="red" textAlign="center">
                  la brigade
                </Title>
                <Text color="beige" textAlign="center">
      Severity: Major
      Found in packages/mobile/src/pages/samples/Game/Popup/PhoneCall.tsx and 1 other location - About 1 hr to fix
      packages/mobile/src/pages/samples/Game/Popup/Report/ReportComplete.tsx on lines 10..18

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

      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">
            <StyledTitle preset="H2" color="red" textAlign="center">
              La brigade
            </StyledTitle>
            <StyledText color="beige" textAlign="center">
      packages/mobile/src/pages/samples/Game/Popup/PhoneCall.tsx on lines 15..22

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

      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 startGame has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Confirmed

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

        Function SlideToAnswer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Confirmed

        const SlideToAnswer: FC<SlideToAnswerProps> = ({
          onHangUp,
          onPickUp,
          touchable
        }) => {
        Severity: Minor
        Found in packages/mobile/src/components/shared/SlideToAnswer.tsx - About 1 hr 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 MiniGame has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const MiniGame: FC<MiniGameProps> = props => {
          const { uuid, player, winner, type } = props
          const [pending, setPending] = useState<PendingState>(undefined)
          const [ready, setReady] = useState<boolean>(false)
          const { theme, setTheme } = useTheme()
        Severity: Minor
        Found in packages/mobile/src/pages/Game/Main/MiniGame/index.tsx - About 1 hr to fix

          Function NotificationSample has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const NotificationSample = () => {
            const [notification, setNotification] = useState([])
            const { setTheme } = useTheme()
          
            const mock = () => {
          Severity: Minor
          Found in packages/mobile/src/pages/samples/Notification.tsx - About 1 hr to fix

            Function Pending has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Confirmed

            const Pending = () => {
              return (
                <>
                  <Component>
                    <Container alignSelf="center">
            Severity: Minor
            Found in packages/mobile/src/pages/samples/Pending.tsx - About 1 hr to fix

              Function reportPlayer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Confirmed

                  async reportPlayer(_, { fromUUID, toUUID }) {
                    const [from, to] = await Promise.all(
                      [fromUUID, toUUID].map(uuid =>
                        Player.findByUUID(uuid, {
                          withRelated: ['game']
              Severity: Minor
              Found in packages/server/app/graphql/resolvers/report.ts - About 1 hr to fix

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

                  {
                    name: 'get-up',
                    displayName: 'Lève-toi!',
                    playerText:
                      'Monsieur Lane ne veut pas se lever. Vous cédez votre place à Madame Henriette la biquette qui vous remercie.',
                Severity: Major
                Found in packages/shared/data/cards/civil.ts and 10 other locations - About 1 hr to fix
                packages/shared/data/cards/civil.ts on lines 55..71
                packages/shared/data/cards/civil.ts on lines 72..88
                packages/shared/data/cards/civil.ts on lines 89..105
                packages/shared/data/cards/civil.ts on lines 106..122
                packages/shared/data/cards/civil.ts on lines 123..139
                packages/shared/data/cards/civil.ts on lines 140..156
                packages/shared/data/cards/civil.ts on lines 157..173
                packages/shared/data/cards/civil.ts on lines 174..190
                packages/shared/data/cards/civil.ts on lines 209..225
                packages/shared/data/cards/civil.ts on lines 226..242

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

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

                  {
                    name: 'umbrella',
                    displayName: 'Le parapluie',
                    playerText:
                      'Thierry Kermite ouvre son parapluie sans faire attention. Changez de trottoir pour gagner du temps.',
                Severity: Major
                Found in packages/shared/data/cards/civil.ts and 10 other locations - About 1 hr to fix
                packages/shared/data/cards/civil.ts on lines 4..20
                packages/shared/data/cards/civil.ts on lines 55..71
                packages/shared/data/cards/civil.ts on lines 72..88
                packages/shared/data/cards/civil.ts on lines 89..105
                packages/shared/data/cards/civil.ts on lines 106..122
                packages/shared/data/cards/civil.ts on lines 123..139
                packages/shared/data/cards/civil.ts on lines 140..156
                packages/shared/data/cards/civil.ts on lines 174..190
                packages/shared/data/cards/civil.ts on lines 209..225
                packages/shared/data/cards/civil.ts on lines 226..242

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

                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