ethanneff/example

View on GitHub

Showing 120 of 120 total issues

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

  it('3 months ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { months: 3 }));
    expect(formatRelativeDate(date)).toBe('13w');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..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 67.

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

export const ForgotPassword = () => {
  const [email, setEmail] = useState('');
  const { goBack } = useNavigation();
  const handleEmail = useCallback((value: string) => {
    setEmail(value);
Severity: Minor
Found in src/apps/Portfolio/ForgotPassword/index.tsx - About 1 hr to fix

    Method initializeFlipper has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
        if (FlipperUtils.shouldEnableFlipper(context)) {
          final FlipperClient client = AndroidFlipperClient.getInstance(context);
    
          client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));

      Function GameOfLife has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const GameOfLife = () => {
        const colors = useColors();
        const [loading, setLoading] = useState(true);
        const dispatch = useAppDispatch();
        const { goBack } = useNavigation();
      Severity: Minor
      Found in src/apps/Playground/Games/GameOfLife/index.tsx - About 1 hr to fix

        Function CalendarHeader has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const CalendarHeader = () => {
          const dispatch = useAppDispatch();
          const activeMonth = useAppSelector((state) => state.calendar.activeMonth);
          const month = format(activeMonth, 'MMMM yyyy');
        
        
        Severity: Minor
        Found in src/components/Calendar/CalendarHeader.tsx - About 1 hr to fix

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

          export const Progress = () => (
            <Stack.Navigator screenOptions={noHeader}>
              <Stack.Screen
                component={Home}
                name="home"
          Severity: Major
          Found in src/apps/Progress/index.tsx and 4 other locations - About 1 hr to fix
          src/apps/CantHurtMe/index.tsx on lines 8..15
          src/apps/ComfortZone/index.tsx on lines 8..15
          src/apps/Journal/index.tsx on lines 8..15
          src/apps/TheOneThing/index.tsx on lines 8..15

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

          export const ComfortZone = () => (
            <Stack.Navigator screenOptions={noHeader}>
              <Stack.Screen
                component={Home}
                name="home"
          Severity: Major
          Found in src/apps/ComfortZone/index.tsx and 4 other locations - About 1 hr to fix
          src/apps/CantHurtMe/index.tsx on lines 8..15
          src/apps/Journal/index.tsx on lines 8..15
          src/apps/Progress/index.tsx on lines 8..15
          src/apps/TheOneThing/index.tsx on lines 8..15

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

          export const CantHurtMe = () => (
            <Stack.Navigator screenOptions={noHeader}>
              <Stack.Screen
                component={Home}
                name="home"
          Severity: Major
          Found in src/apps/CantHurtMe/index.tsx and 4 other locations - About 1 hr to fix
          src/apps/ComfortZone/index.tsx on lines 8..15
          src/apps/Journal/index.tsx on lines 8..15
          src/apps/Progress/index.tsx on lines 8..15
          src/apps/TheOneThing/index.tsx on lines 8..15

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

          export const TheOneThing = () => (
            <Stack.Navigator screenOptions={noHeader}>
              <Stack.Screen
                component={Home}
                name="home"
          Severity: Major
          Found in src/apps/TheOneThing/index.tsx and 4 other locations - About 1 hr to fix
          src/apps/CantHurtMe/index.tsx on lines 8..15
          src/apps/ComfortZone/index.tsx on lines 8..15
          src/apps/Journal/index.tsx on lines 8..15
          src/apps/Progress/index.tsx on lines 8..15

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

          export const Journal = () => (
            <Stack.Navigator screenOptions={noHeader}>
              <Stack.Screen
                component={Home}
                name="home"
          Severity: Major
          Found in src/apps/Journal/index.tsx and 4 other locations - About 1 hr to fix
          src/apps/CantHurtMe/index.tsx on lines 8..15
          src/apps/ComfortZone/index.tsx on lines 8..15
          src/apps/Progress/index.tsx on lines 8..15
          src/apps/TheOneThing/index.tsx on lines 8..15

          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

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

          const Pillar = () => {
            const colors = useColors();
            const useNativeDriver = useDriver();
            const location = useRef(new Animated.ValueXY({ x: 0, y: 0 }));
            const state = useRef({ direction: 1, x: 0, y: 0 });
          Severity: Minor
          Found in src/apps/Playground/Games/FlappyBird/index.tsx - About 1 hr to fix

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

                  <ScrollView
                    contentContainerStyle={{ padding: spacing(4) }}
                    style={{ backgroundColor: colors.background.secondary }}
                  >
                    <Card>
            Severity: Major
            Found in src/apps/DeepWork/Account.tsx and 1 other location - About 1 hr to fix
            src/apps/DeepWork/Day.tsx on lines 16..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 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

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

                  <ScrollView
                    contentContainerStyle={{
                      backgroundColor: colors.background.secondary,
                      padding: spacing(4),
                    }}
            Severity: Major
            Found in src/apps/DeepWork/Day.tsx and 1 other location - About 1 hr to fix
            src/apps/DeepWork/Account.tsx on lines 15..28

            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

            Function Buttons has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const Buttons = () => {
              const dispatch = useAppDispatch();
              const run = useAppSelector((state) => state.gameOfLife.run);
              const onRandom = useCallback(() => dispatch(resetBoard(0.5)), [dispatch]);
              const onStart = useCallback(() => dispatch(toggleRun()), [dispatch]);
            Severity: Minor
            Found in src/apps/Playground/Games/GameOfLife/Buttons.tsx - About 1 hr to fix

              Function Welcome has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const Welcome = () => {
                const dispatch = useAppDispatch();
                const { signInAnonymously } = useAuth();
              
                const handleLogin = useCallback(async () => {
              Severity: Minor
              Found in src/apps/Complete/screens/Welcome/index.tsx - About 1 hr to fix

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

                  const y =
                    dy < 0
                      ? 0
                      : dy + position.size > position.canvas.height
                        ? position.canvas.height - position.size
                Severity: Major
                Found in src/apps/Playground/Games/Drift/utils.ts and 1 other location - About 1 hr to fix
                src/apps/Playground/Games/Drift/utils.ts on lines 22..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 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

                  const x =
                    dx < 0
                      ? 0
                      : dx + position.size > position.canvas.width
                        ? position.canvas.width - position.size
                Severity: Major
                Found in src/apps/Playground/Games/Drift/utils.ts and 1 other location - About 1 hr to fix
                src/apps/Playground/Games/Drift/utils.ts on lines 16..21

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

                export const BouncingBalls = () => {
                  const colors = useColors();
                  const { goBack } = useNavigation();
                  const { layout, onLayout } = useLayout();
                  const styles = StyleSheet.create({
                Severity: Minor
                Found in src/apps/Playground/Features/BouncingBalls/index.tsx - About 1 hr to fix

                  Function Colors has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const Colors = () => {
                    const { goBack } = useNavigation();
                  
                    return (
                      <Screen
                  Severity: Minor
                  Found in src/apps/Playground/Components/Colors/index.tsx - About 1 hr to fix

                    Function Chat has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const Chat = () => {
                      const { goBack } = useNavigation();
                      const { insets, layout, onLayout } = useLayout();
                      const keyboardHeight = useAppSelector((s) => s.device.keyboardHeight);
                      const bottomInset = keyboardHeight > 0 ? insets.bottom : 0;
                    Severity: Minor
                    Found in src/apps/Playground/Features/Chat/index.tsx - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language