ethanneff/example

View on GitHub

Showing 120 of 120 total issues

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

          <ButtonsRow>
            <ButtonRound
              background={colors.background.disabled}
              color="primaryA"
              onPress={lap}
Severity: Major
Found in src/apps/Playground/Creations/AppleStopwatch/index.tsx and 1 other location - About 2 hrs to fix
src/apps/Playground/Creations/AppleStopwatch/index.tsx on lines 142..155

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

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

export const Fonts = () => {
  const { goBack } = useNavigation();
  const colors = useColors();

  return (
Severity: Major
Found in src/apps/Playground/Components/Fonts/index.tsx - About 2 hrs to fix

    Function Ball has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const Ball = () => {
      const { layout, onLayout } = useLayout();
      const { goBack } = useNavigation();
      const ballPosition = useRef(new Animated.ValueXY({ x: 0, y: 0 }));
      const useNativeDriver = useDriver();
    Severity: Major
    Found in src/apps/Playground/Creations/Ball/index.tsx - About 2 hrs to fix

      Function EditItem has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const EditItem = () => {
        const dispatch = useAppDispatch();
        const activeMessage = useAppSelector(getActiveChatMessage);
        const messageReference = useRef(activeMessage?.message ?? '');
      
      
      Severity: Major
      Found in src/apps/Playground/Features/Chat/EditItem.tsx - About 2 hrs to fix

        File index.tsx has 274 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useCallback, useState } from 'react';
        import { v4 } from 'uuid';
        import {
          Button,
          Card,
        Severity: Minor
        Found in src/apps/Playground/Creations/WeekendPlanner/index.tsx - About 2 hrs to fix

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

                    <View style={{ flexDirection: 'row', justifyContent: 'center' }}>
                      <Button
                        center
                        color="secondary"
                        onPress={handleComplete}
          Severity: Major
          Found in src/features/RateApp/index.tsx and 1 other location - About 2 hrs to fix
          src/features/RateApp/index.tsx on lines 146..159

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                    <View style={{ flexDirection: 'row', justifyContent: 'center' }}>
                      <Button
                        center
                        color="secondary"
                        onPress={handleComplete}
          Severity: Major
          Found in src/features/RateApp/index.tsx and 1 other location - About 2 hrs to fix
          src/features/RateApp/index.tsx on lines 112..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 86.

          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

            it('getCurrentTheme dark', () => {
              expect.hasAssertions();
              const store = Testing.reduxStore();
              store.dispatch(changeTheme('dark'));
              expect(getCurrentTheme(store.getState())).toMatchObject({
          Severity: Major
          Found in src/redux/reducers/Theme/__tests__/index.tsx and 1 other location - About 2 hrs to fix
          src/redux/reducers/Theme/__tests__/index.tsx on lines 21..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 84.

          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

            it('getCurrentTheme light', () => {
              expect.hasAssertions();
              const store = Testing.reduxStore();
              store.dispatch(changeTheme('light'));
              expect(getCurrentTheme(store.getState())).toMatchObject({
          Severity: Major
          Found in src/redux/reducers/Theme/__tests__/index.tsx and 1 other location - About 2 hrs to fix
          src/redux/reducers/Theme/__tests__/index.tsx on lines 12..19

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

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

          export const PinchSpread = () => {
            const [state, setState] = useState({ pinchCount: 0, spreadCount: 0 });
            const colors = useColors();
            const { goBack } = useNavigation();
            const styles = StyleSheet.create({
          Severity: Major
          Found in src/apps/Playground/Features/PinchSpread/index.tsx - About 2 hrs to fix

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

              it('shows secondary right nav', () => {
                expect.assertions(1);
                Testing.renderComponent(
                  <NavBar
                    onSecondRightPress={jest.fn()}
            Severity: Major
            Found in src/components/Screen/__tests__/NavBar.test.tsx and 1 other location - About 2 hrs to fix
            src/components/Screen/__tests__/NavBar.test.tsx on lines 7..16

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

            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

              it('shows secondary left nav', () => {
                expect.assertions(1);
                Testing.renderComponent(
                  <NavBar
                    onSecondLeftPress={jest.fn()}
            Severity: Major
            Found in src/components/Screen/__tests__/NavBar.test.tsx and 1 other location - About 2 hrs to fix
            src/components/Screen/__tests__/NavBar.test.tsx on lines 18..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 82.

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

            export const SkeletonLoading = () => {
              const { goBack } = useNavigation();
              const colors = useColors();
              const mounted = useRef(true);
              const [loading, setLoading] = useState(true);
            Severity: Major
            Found in src/apps/Playground/Features/SkeletonLoader/index.tsx - About 2 hrs to fix

              Function Reflect has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const Reflect = () => {
                const colors = useColors();
                const { tabBarEdges } = useLayout();
              
                return (
              Severity: Major
              Found in src/apps/Complete/screens/Reflect/index.tsx - About 2 hrs to fix

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

                export const Home = () => {
                  const colors = useColors();
                  const { onLeftPress } = useAdminNavBack();
                  const styles = StyleSheet.create({
                    background: {
                Severity: Minor
                Found in src/apps/Progress/Home.tsx - About 2 hrs to fix

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

                              <TextInput
                                autoCapitalize="none"
                                autoComplete="off"
                                autoCorrect
                                blurOnSubmit
                  Severity: Major
                  Found in src/apps/Playground/Creations/WeekendPlanner/index.tsx and 1 other location - About 1 hr to fix
                  src/apps/Playground/Features/Chat/EditItem.tsx on lines 47..61

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

                  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

                        <TextInput
                          autoCapitalize="sentences"
                          autoComplete="off"
                          autoCorrect
                          blurOnSubmit
                  Severity: Major
                  Found in src/apps/Playground/Features/Chat/EditItem.tsx and 1 other location - About 1 hr to fix
                  src/apps/Playground/Creations/WeekendPlanner/index.tsx on lines 250..264

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

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

                  export const formatRelativeDate = (date: Date): string => {
                    const today = new Date();
                    const years = differenceInYears(today, date);
                    const weeks = differenceInWeeks(today, date);
                    const days = differenceInDays(today, date);
                  Severity: Minor
                  Found in src/apps/Playground/Features/SwipeFeed/utils.ts - 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 generateButtons has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const generateButtons = () => {
                    const today = new Date();
                    const laterToday = set(add(today, { minutes: 30 }), { hours: 3, minutes: 0 });
                    const yesterday = sub(today, { days: 1 });
                    const evening = set(today, { hours: 18, minutes: 0 });
                  Severity: Minor
                  Found in src/apps/Playground/Components/Modals/Reminders/OneTime.tsx - About 1 hr to fix

                    Function LoadingProfile has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const LoadingProfile = () => {
                      const colors = useColors();
                      const banner = spacing(24);
                    
                      return (
                    Severity: Minor
                    Found in src/apps/Playground/Features/SkeletonLoader/LoadingProfile.tsx - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language