Skip to content

Fix all type errors and formatted files

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (master) failed Oct 20, 2023 in 39s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

  • Declining Code Health: 4 findings(s) 🚩
  • Improving Code Health: 1 findings(s) βœ…
  • Affected Hotspots: 2 files(s) πŸ”₯

Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method RecipeForm.tsx: RecipeForm
  • Complex Method recipeRouter.ts: recipeRouter πŸ”₯
  • Large Method recipeView.tsx: RecipeView πŸ”₯
  • Complex Conditional page.tsx: RecipeEditPage

βœ… Improving Code Health:

  • Large Method seed.ts: main

Annotations

Check warning on line 1 in src/app/(dashboard)/dashboard/recipe/[recipeId]/edit/page.tsx

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (master)

❌ New issue: Complex Conditional

RecipeEditPage has 1 complex conditionals with 2 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.

Check warning on line 306 in src/components/forms/recipe/RecipeForm.tsx

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (master)

❌ New issue: Complex Method

RecipeForm has a cyclomatic complexity of 11, threshold = 10. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 218 in src/components/recipeView.tsx

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (master)

❌ Getting worse: Large Method

RecipeView increases from 179 to 191 lines of code, threshold = 120. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.

Check warning on line 330 in src/trpc/recipe/recipeRouter.ts

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (master)

❌ Getting worse: Complex Method

recipeRouter already has high cyclomatic complexity, and now it increases in Lines of Code from 243 to 270. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check notice on line 35 in prisma/seed.ts

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (master)

βœ… Getting better: Large Method

main decreases from 78 to 76 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.