Skip to content

add task solution#3325

Open
nols212 wants to merge 4 commits into
mate-academy:masterfrom
nols212:develop
Open

add task solution#3325
nols212 wants to merge 4 commits into
mate-academy:masterfrom
nols212:develop

Conversation

@nols212
Copy link
Copy Markdown

@nols212 nols212 commented May 24, 2026

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your implementation correctly satisfies all functional requirements. The getArea methods properly use this, triangle calculation uses Heron's formula correctly, circles use Math.PI, and the getInfo function returns the expected format. However, the ESLint check identified several style issues in your test file that need attention: there are duplicate class/function declarations (Triangle, Circle, Rectangle, and getInfo appear to be defined multiple times), and there are some style violations like missing blank lines between class members and a missing semicolon. You can auto-fix most of these by running npx eslint src/figuresClasses.test.ts --fix, then manually remove the duplicate declarations. The functional implementation is solid—focus on cleaning up the linting issues and removing any duplicate code blocks.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Error messages are generic placeholders ('your error message') instead of detailed descriptions explaining what validation failed. Checklist item #3 requires error messages to be descriptive. For example: Triangle sides: 'All triangle sides must be greater than 0' and 'Triangle sides cannot form a valid triangle: longest side must be less than sum of other two sides'; Circle: 'Circle radius must be greater than 0'; Rectangle: 'Rectangle width and height must be greater than 0'. Additionally, ESLint style violations: Missing blank lines between class members in src/figuresClasses.ts (9 errors). You can auto-fix these by running npx eslint src/figuresClasses.ts --fix.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/figuresClasses.ts Outdated
Comment on lines +21 to +22
if (a <= 0 || b <= 0 || c <= 0) {
throw new Error('your error message');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #3: error messages should be detailed descriptions. Change to something like 'All triangle sides must be greater than 0'

Comment thread src/figuresClasses.ts Outdated
Comment on lines +28 to +29
if (max >= sum - max) {
throw new Error('your error message');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #3: error messages should be detailed descriptions. Change to something like 'Triangle sides cannot form a valid triangle: longest side must be less than sum of other two sides'

Comment thread src/figuresClasses.ts Outdated
Comment on lines +55 to +56
if (radius <= 0) {
throw new Error('your error message');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #3: error messages should be detailed descriptions. Change to something like 'Circle radius must be greater than 0'

Comment thread src/figuresClasses.ts Outdated
Comment on lines +80 to +81
if (width <= 0 || height <= 0) {
throw new Error('your error message');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #3: error messages should be detailed descriptions. Change to something like 'Rectangle width and height must be greater than 0'

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

The request meets the required criteria for approval.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/figuresClasses.ts Outdated
Comment on lines +12 to +37
color: Color;

a: number;

b: number;

c: number;

constructor(color: Color, a: number, b: number, c: number) {
if (a <= 0 || b <= 0 || c <= 0) {
throw new Error('All triangle sides must be greater than 0');
}

const max = Math.max(a, b, c);
const sum = a + b + c;

if (max >= sum - max) {
throw new Error(
'Triangle sides cannot form a valid triangle: longest side must be less than sum of other two sides',
);
}

this.color = color;
this.a = a;
this.b = b;
this.c = c;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #4: Constructor parameters with access modifiers implicitly create class properties. Instead of declaring properties separately and assigning in constructor body, use access modifiers directly on parameters.

BAD: this.a = a; this.b = b; this.c = c; in constructor body
GOOD: constructor(private color: Color, private a: number, ...)

Comment thread src/figuresClasses.ts Outdated
Comment on lines +51 to +61
color: Color;

export class Rectangle implements Figure {}
radius: number;

constructor(color: Color, radius: number) {
if (radius <= 0) {
throw new Error('Circle radius must be greater than 0');
}

this.color = color;
this.radius = radius;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #4: Same issue here. Use constructor(private color: Color, private radius: number) instead of separate property declaration and manual assignment.

Comment thread src/figuresClasses.ts Outdated
Comment on lines +74 to +87
color: Color;

width: number;

height: number;

constructor(color: Color, width: number, height: number) {
if (width <= 0 || height <= 0) {
throw new Error('Rectangle width and height must be greater than 0');
}

this.color = color;
this.width = width;
this.height = height;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #4: Same issue here. Use constructor(private color: Color, private width: number, private height: number) instead of separate property declarations and manual assignment.

Copy link
Copy Markdown

@vadiimvooo vadiimvooo left a comment

Choose a reason for hiding this comment

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

Well done

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.

3 participants