Skip to content
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

chore: Refactor to solve smells #84

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Siva-2707
Copy link

Resolved some Implementations smells

SM_Method.java

  • parse() method was a Complex Method, so have extracted the code into various methods.

TypeInfo.java

  • Magic number (2) was used. Introduced a variable COMMA_LENGTH to give more understanding of the usage.

ImplementationSmellDetector.java

  • ABSTRACT_FUMCTION_CALL_FROM_CONSTRUCTOR was a very long variable name causing Long Identifier smell. I have changed that to ABST_FUNC_CALL_FRM_CTOR. Which makes it short and understandable.

@Siva-2707 Siva-2707 changed the title chore: Refactor to solve Implementation smells chore: Refactor to solve smells Nov 28, 2024
@Siva-2707
Copy link
Author

  • Resolved one Rebellious Hierarchy smell by introducing a Parsable interface.

  • Resolved Insufficient modularization smell in TypeMetrics class by moving the methods to a different class (TypeMetricsExtractor)

  • Resolved Broken Hierarchy smell. TypeMetics was extending MetricsExtrator) This was breaking is-a relationship which was causing the Broken Hierachy smell. Introduced a new class Metrics to resolve that. And moved the extraction method to the corresponding class.

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.

1 participant