Skip to content

solution#3337

Open
Grigoriy01 wants to merge 1 commit into
mate-academy:masterfrom
Grigoriy01:develop
Open

solution#3337
Grigoriy01 wants to merge 1 commit into
mate-academy:masterfrom
Grigoriy01:develop

Conversation

@Grigoriy01
Copy link
Copy Markdown

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 is correct and meets all functional requirements. The three figure classes properly implement the Figure interface with accurate area calculations using Heron's formula and Math.PI. The validation logic correctly throws errors for invalid inputs. The issues identified are non-blocking quality improvements: 1. The hight typo in the Rectangle class (lines 65 and 71) is a naming inconsistency but won't cause runtime errors since it's used consistently within the class. 2. The error messages at line 26 and line 49 could be more descriptive per [CHECKLIST ITEM #3], but the underlying validation logic functions correctly. These are minor issues that don't prevent the code from working as specified. In a production environment, I'd recommend fixing the typo for clarity and enhancing the error messages for better debugging, but for this task's completion, the core functionality is solid and the implementation is sound.


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

Footnotes

  1. Rate AI review example

Comment thread src/figuresClasses.ts

constructor(
public readonly color: Color,
private readonly width: number,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typo: 'hight' should be 'height' to match the task description. This typo propagates to lines 65 and 71.

Comment thread src/figuresClasses.ts
Comment on lines +25 to +26
if (maxSide >= sumLengthTwoSides) {
throw new Error('Length of the longer side: invalid value');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to checklist item #3, error messages should be detailed. Consider: "The longest side must be less than the sum of the other two sides" instead of the generic "invalid value".

Comment thread src/figuresClasses.ts
Comment on lines +48 to +49
if (this.radius <= 0) {
throw new Error('The radius is equal to zero.');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The condition checks this.radius <= 0 but the message says "equal to zero". For consistency, consider: "The radius must be greater than zero" to cover both zero and negative cases.

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