ethanneff/example

View on GitHub

Showing 120 of 120 total issues

File config.ts has 7116 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as I from '@mdi/js';

// https://textedit.tools/kebabcase
export const icon = {
  'ab-testing': I.mdiAbTesting,
Severity: Major
Found in src/components/Icon/config.ts - About 2 wks to fix

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

      light: {
        blue: {
          '100': '#e0f2ff',
          '200': '#cae8ff',
          '300': '#b5deff',
    Severity: Major
    Found in src/features/Config/palette.ts and 1 other location - About 6 days to fix
    src/features/Config/palette.ts on lines 38..263

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

    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

      dark: {
        blue: {
          '100': '#003877',
          '200': '#00418a',
          '300': '#004da3',
    Severity: Major
    Found in src/features/Config/palette.ts and 1 other location - About 6 days to fix
    src/features/Config/palette.ts on lines 264..489

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

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

    export const WeekendPlanner = () => {
      const colors = useColors();
      const { goBack } = useNavigation();
      const dropShadow = useDropShadow();
      const height = useAppSelector(getLargestDimension);
    Severity: Major
    Found in src/apps/Playground/Creations/WeekendPlanner/index.tsx - About 1 day to fix

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

      export const useIntervals = () => {
        const dispatch = useAppDispatch();
        const uid = useAppSelector((state) => state.focus.auth.uid);
      
        useEffect(() => {
      Severity: Major
      Found in src/apps/Focus/data/sync/useIntervals.ts and 1 other location - About 1 day to fix
      src/apps/Focus/data/sync/useGoals.ts on lines 8..32

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

      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

      export const useGoals = () => {
        const dispatch = useAppDispatch();
        const uid = useAppSelector((state) => state.focus.auth.uid);
      
        useEffect(() => {
      Severity: Major
      Found in src/apps/Focus/data/sync/useGoals.ts and 1 other location - About 1 day to fix
      src/apps/Focus/data/sync/useIntervals.ts on lines 8..32

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

      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

      File palette.ts has 486 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      type Color =
        | 'blue'
        | 'celery'
        | 'chartreuse'
        | 'cyan'
      Severity: Minor
      Found in src/features/Config/palette.ts - About 7 hrs to fix

        Function Crash has 160 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const Crash = () => {
          const colors = useColors();
          const { goBack } = useNavigation();
        
          const [playerGame, setPlayerGame] = useState<PlayerGame>({
        Severity: Major
        Found in src/apps/Playground/Games/Crash/index.tsx - About 6 hrs to fix

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

          export const Home = () => {
            const colors = useColors();
            const { onLeftPress } = useAdminNavBack();
            const styles = StyleSheet.create({
              bottom: {
          Severity: Major
          Found in src/apps/Journal/Home.tsx - About 6 hrs to fix

            Function Inputs has 146 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const Inputs = () => {
              const { goBack } = useNavigation();
              const colors = useColors();
            
              const [form, setForm] = useState({
            Severity: Major
            Found in src/apps/Playground/Components/Inputs/index.tsx - About 5 hrs to fix

              Function Startup has 140 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const Startup = () => {
                const colors = useColors();
                const { goBack } = useNavigation();
                const [form, setForm] = useState<Form>(initialState);
                const launchWeeks = Number.parseInt(form.launchWeeks, 10);
              Severity: Major
              Found in src/apps/Playground/Creations/Startup/index.tsx - About 5 hrs to fix

                Function ItemDetail has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const ItemDetail = () => {
                  const dispatch = useAppDispatch();
                  const { goBack } = useNavigation();
                  const colors = useColors();
                  const { itemId, parentItemId } = useAppSelector((s) => s.complete.item.nav);
                Severity: Major
                Found in src/apps/Complete/screens/ItemDetail/index.tsx - About 5 hrs to fix

                  Function AppleStopwatch has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const AppleStopwatch = () => {
                    const { goBack } = useNavigation();
                    const [state, setState] = useState<State>({
                      laps: [],
                      now: 0,
                  Severity: Major
                  Found in src/apps/Playground/Creations/AppleStopwatch/index.tsx - About 5 hrs to fix

                    Function OKRs has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const OKRs = () => {
                      const { goBack } = useNavigation();
                      const colors = useColors();
                    
                      return (
                    Severity: Major
                    Found in src/apps/Playground/Creations/OKRs/index.tsx - About 5 hrs to fix

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

                      export const userSchema = z.object({
                        displayName: z.nullable(z.string()),
                        email: z.nullable(z.string()),
                        emailVerified: z.boolean(),
                        id: z.string(),
                      Severity: Major
                      Found in src/apps/Focus/data/types.ts and 1 other location - About 4 hrs to fix
                      src/apps/Checklists/data/types.ts on lines 3..10

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                      export const userSchema = z.object({
                        displayName: z.nullable(z.string()),
                        email: z.nullable(z.string()),
                        emailVerified: z.boolean(),
                        id: z.string(),
                      Severity: Major
                      Found in src/apps/Checklists/data/types.ts and 1 other location - About 4 hrs to fix
                      src/apps/Focus/data/types.ts on lines 3..10

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

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

                      export const Modals = () => {
                        const { goBack } = useNavigation();
                        const colors = useColors();
                        const [modal, setModal] = useState<Modal>(null);
                        const handleModalChange = useCallback(
                      Severity: Major
                      Found in src/apps/Playground/Components/Modals/index.tsx - About 4 hrs to fix

                        Function getMatches has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const getMatches = (board: Board): Matches => {
                          const matches: Matches = {};
                          for (let rowIndex = 0; rowIndex < board.length; rowIndex++)
                            for (let colIndex = 0; colIndex < board[rowIndex].length; colIndex++) {
                              const mid = board[rowIndex][colIndex];
                        Severity: Minor
                        Found in src/apps/Playground/Games/Bejeweled/index.tsx - About 3 hrs 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 Bejeweled has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const Bejeweled = () => {
                          const { goBack } = useNavigation();
                          const dimension = useAppSelector(getSmallestDimension);
                        
                          const colors = useColors();
                        Severity: Major
                        Found in src/apps/Playground/Games/Bejeweled/index.tsx - About 3 hrs to fix

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

                                    <ButtonsRow>
                                      <ButtonRound
                                        background={colors.background.negative}
                                        color="primaryA"
                                        onPress={reset}
                          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 126..139

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language