-
Notifications
You must be signed in to change notification settings - Fork 0
test: max_files=2 - should only review first 2 of 4 files #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: AI Code Review (max 2 files) | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| review: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: concretios/ai-pr-reviewer@v1 | ||
| with: | ||
| gemini_api_key: ${{ secrets.GEMINI_API_KEY }} | ||
| max_files: '2' | ||
| submit_review_verdict: false |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||
| // Category model | ||||||
|
|
||||||
| class Category { | ||||||
| constructor(name, color) { | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [MEDIUM] quality: Missing The |
||||||
| this.id = null; | ||||||
| this.name = name; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [LOW] style: Missing JSDoc comments for class methods The coding standards require all functions to have JSDoc comments describing parameters and return values. This improves code readability and maintainability for the |
||||||
| this.color = color; | ||||||
| this.tasks = []; | ||||||
| } | ||||||
|
|
||||||
| validate() { | ||||||
| if (this.name == null) { | ||||||
| return false; | ||||||
| } | ||||||
| return true; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [MEDIUM] correctness: Incomplete The Suggestion:
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| addTask(task) { | ||||||
| this.tasks.push(task); | ||||||
| } | ||||||
|
|
||||||
| removeTask(taskId) { | ||||||
| this.tasks = this.tasks.filter(t => t.id != taskId); | ||||||
| } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [MEDIUM] correctness: Use strict equality in Using Suggestion:
Suggested change
|
||||||
|
|
||||||
| getTaskCount() { | ||||||
| return this.tasks.length; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [MEDIUM] correctness: Use strict equality The Suggestion:
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| toJSON() { | ||||||
| return { | ||||||
| id: this.id, | ||||||
| name: this.name, | ||||||
| color: this.color, | ||||||
| taskCount: this.getTaskCount() | ||||||
| }; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| module.exports = Category; | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||
| // Barrel export for all models | ||||||
|
|
||||||
| const Task = require('./task'); | ||||||
| const User = require('./user'); | ||||||
| const Category = require('./category'); | ||||||
|
|
||||||
| module.exports = { | ||||||
| Task, | ||||||
| User, | ||||||
| Category | ||||||
| }; | ||||||
|
|
||||||
| function createTask(title, desc) { | ||||||
| var t = new Task(title, desc); | ||||||
| return t; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [LOW] style: Missing JSDoc comments for factory functions The coding standards require all functions to have JSDoc comments describing parameters and return values. This applies to the |
||||||
| } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [LOW] style: Avoid The coding standards explicitly state to use Suggestion:
Suggested change
|
||||||
|
|
||||||
| function createUser(name, email, pwd) { | ||||||
| var u = new User(name, email, pwd); | ||||||
| return u; | ||||||
| } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [LOW] style: Avoid The coding standards explicitly state to use Suggestion:
Suggested change
|
||||||
|
|
||||||
| function createCategory(name, color) { | ||||||
| var c = new Category(name, color); | ||||||
| return c; | ||||||
| } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 [LOW] style: Avoid The coding standards explicitly state to use Suggestion:
Suggested change
|
||||||
|
|
||||||
| module.exports.createTask = createTask; | ||||||
| module.exports.createUser = createUser; | ||||||
| module.exports.createCategory = createCategory; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Task model | ||
|
|
||
| class Task { | ||
| constructor(title, description) { | ||
| this.id = null; | ||
| this.title = title; | ||
| this.description = description; | ||
| this.completed = false; | ||
| this.createdAt = new Date(); | ||
| } | ||
|
|
||
| validate() { | ||
| if (!this.title) { | ||
| return false; | ||
| } | ||
| if (this.title.length > 500) { | ||
| return false; | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| complete() { | ||
| this.completed = true; | ||
| // BUG: should also set a completedAt timestamp | ||
| } | ||
|
|
||
| toJSON() { | ||
| return { | ||
| id: this.id, | ||
| title: this.title, | ||
| description: this.description, | ||
| completed: this.completed, | ||
| createdAt: this.createdAt | ||
| }; | ||
| } | ||
|
|
||
| toString() { | ||
| return this.title + " - " + this.description + " (" + this.completed + ")"; | ||
| } | ||
| } | ||
|
|
||
| module.exports = Task; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // User model | ||
|
|
||
| class User { | ||
| constructor(name, email, password) { | ||
| this.id = null; | ||
| this.name = name; | ||
| this.email = email; | ||
| this.password = password; // storing plain text password | ||
| this.tasks = []; | ||
| this.createdAt = new Date(); | ||
| } | ||
|
|
||
| validate() { | ||
| if (!this.name || !this.email) { | ||
| return false; | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| addTask(task) { | ||
| this.tasks.push(task); | ||
| } | ||
|
|
||
| getTasks() { | ||
| return this.tasks; | ||
| } | ||
|
|
||
| toJSON() { | ||
| return { | ||
| id: this.id, | ||
| name: this.name, | ||
| email: this.email, | ||
| password: this.password, | ||
| tasks: this.tasks, | ||
| createdAt: this.createdAt | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| module.exports = User; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 [MEDIUM] style: Missing JSDoc comments for class and methods
The
Categoryclass and its methods lack JSDoc comments, which makes understanding their purpose, parameters, and return values more difficult. This violates the project's coding standards requiring JSDoc for all functions.