Skip to content

feat: add daysBetween helper#1

Open
adeelcentrox wants to merge 5 commits into
mainfrom
demo/inline-review-test
Open

feat: add daysBetween helper#1
adeelcentrox wants to merge 5 commits into
mainfrom
demo/inline-review-test

Conversation

@adeelcentrox
Copy link
Copy Markdown
Owner

Demo fixture for automated code review pipeline — 3 intentional violations (any params, magic number, missing return type).

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Score: 70 / 100
Project: code-review-demo
Reviewer: deepseek

Summary: The diff introduces a single utility function with multiple critical and warning issues: missing return types, use of any without a TODO annotation, and a magic number. The dominant issue category is type_safety.

Category Status

Category Status
structure pass
type_safety fail
code_style warning
security pass
error_handling pass
configuration pass
api_design skipped
testing_patterns skipped

Issue Counts

Total: 3
Critical: 2
Warning: 1
Suggestion: 0

Individual issues are posted as inline comments on the affected lines. Open the Files changed tab to review them.

Comment thread src/utils/date-helper.ts
@@ -0,0 +1,4 @@
export function daysBetween(a: any, b: any) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[critical] Function parameters a and b are typed as any without a TODO annotation.

Suggestion: Replace any with Date and add a TODO if temporary escape is needed, e.g., a: Date, b: Date.

Comment thread src/utils/date-helper.ts
@@ -0,0 +1,4 @@
export function daysBetween(a: any, b: any) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[critical] Function daysBetween is exported but has no explicit return type.

Suggestion: Add explicit return type number to the function signature: export function daysBetween(a: Date, b: Date): number.

Comment thread src/utils/date-helper.ts
@@ -0,0 +1,4 @@
export function daysBetween(a: any, b: any) {
const msPerDay = 86400000;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[warning] The number 86400000 is a magic number used directly in the calculation.

Suggestion: Define a named constant like const MS_PER_DAY = 86400000; and use it instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Automated Code Review

Score: 100 / 100
Severities: blocker=0 major=0 minor=0 nit=0
Dominant category: none

Category Status
structure pass
type_safety pass
code_style pass
security pass
error_handling pass
configuration pass
api_design pass
testing_patterns pass

No issues found. Code follows all applicable guidelines.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Score: 100 / 100
Severities: blocker=0 major=0 minor=0 nit=0
Dominant category: none

Category Status
structure pass
type_safety pass
code_style pass
security pass
error_handling pass
configuration pass
api_design pass
testing_patterns pass

No issues found. Code follows all applicable guidelines.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Automated Code Review

Score: 🟢 100 / 100
Severities: 🔴 blocker=0 🟠 major=0 🟡 minor=0 🔵 nit=0
Dominant category: none

Category Status
structure 🟢 pass
type_safety 🟢 pass
code_style 🟢 pass
security 🟢 pass
error_handling 🟢 pass
configuration 🟢 pass
api_design 🟢 pass
testing_patterns 🟢 pass

No issues found. Code follows all applicable guidelines.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Score: 🟢 100 / 100
Severities: 🔴 blocker=0 🟠 major=0 🟡 minor=0 🔵 nit=0
Dominant category: none

Category Status
structure 🟢 pass
type_safety 🟢 pass
code_style 🟢 pass
security 🟢 pass
error_handling 🟢 pass
configuration 🟢 pass
api_design 🟢 pass
testing_patterns 🟢 pass

No issues found. Code follows all applicable guidelines.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Automated Code Review

Score: 🔴 50 / 100
Severities: 🔴 blocker=2 🟠 major=0 🟡 minor=0 🔵 nit=0
Dominant category: type_safety

Category Status
structure 🟢 pass
type_safety 🔴 fail
code_style 🟢 pass
security 🟢 pass
error_handling 🟢 pass
configuration 🟢 pass
api_design 🟢 pass
testing_patterns ⚪ skipped

The change is small but introduces critical type-safety violations in a shared utility function. Both issues are in the type_safety category and should be fixed before merge by adding explicit parameter and return types.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Score: 🔴 50 / 100
Severities: 🔴 blocker=2 🟠 major=0 🟡 minor=0 🔵 nit=0
Dominant category: type_safety

Category Status
structure 🟢 pass
type_safety 🔴 fail
code_style 🟢 pass
security 🟢 pass
error_handling 🟢 pass
configuration 🟢 pass
api_design 🟢 pass
testing_patterns ⚪ skipped

The change is small but introduces critical type-safety violations in a shared utility function. Both issues are in the type_safety category and should be fixed before merge by adding explicit parameter and return types.

Comment thread src/utils/date-helper.ts
@@ -0,0 +1,4 @@
export function daysBetween(a: any, b: any) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocker] The function signature uses any for both parameters (a: any, b: any) without a TODO escape-hatch note. This creates an unchecked type boundary in shared logic.

Suggestion: Replace any with concrete types, e.g. a: Date, b: Date, or use unknown plus runtime type guards if inputs are not guaranteed.

Comment thread src/utils/date-helper.ts
@@ -0,0 +1,4 @@
export function daysBetween(a: any, b: any) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocker] The exported function daysBetween does not declare an explicit return type. Guidelines require explicit return types for function signatures.

Suggestion: Add an explicit return type: export function daysBetween(a: Date, b: Date): number { ... }.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants