Skip to content

Conversation

@mohammedhashim790
Copy link
Contributor

Hello,
In addition to the previous merge request #85, This MR includes multiple code improvements, such as resolving unfactored hierarchy, consolidating code smell detectors, refactoring methods and variables, addressing magic numbers, and renaming methods for clarity.

Fixes

Refactoring Technique Class Issue Fix
Unfactored Hierarchy ImplementationSmellDetector, DesignSmellDetector ImplementationSmellDetector and DesignSmellDetector classes had an unfactored hierarchy, leading to redundancy and complexity. Resolved the unfactored hierarchy by consolidating the ImplementationSmellDetector and DesignSmellDetector classes into a single class, CodeSmellDetector, to streamline the structure.
Extract Class CodeSmellDetector, ImplementationSmellDetector, DesignSmellDetector Code smells were handled separately in ImplementationSmellDetector and DesignSmellDetector, leading to duplication. Consolidated ImplementationSmellDetector and DesignSmellDetector into a single class, CodeSmellDetector, to reduce redundancy and centralize logic.
Pull Up Method and Variable CodeSmellDetector, ImplementationSmellDetector, DesignSmellDetector Duplicate methods (addToSmells, initializeCodeSmell) and variables (smells) across subclasses. Pulled up the smells variable, addToSmells, and initializeCodeSmell methods into the parent class CodeSmellDetector to promote code reuse and reduce duplication.
Introduce Variable for Magic Number ImplementationSmellDetector Magic number 16 was being used directly in the code, violating best practices. Introduced a new constant variable LONG_RADIX = 16 in the ImplementationSmellDetector class to replace the magic number.
Rename Method ImplementationSmellDetector Method getBooleanRegex() was unclear and inconsistent. Renamed getBooleanRegex() to a more descriptive name to improve clarity.
Rename Method Resolver Method infereParameterized() had a typo in its name. Renamed infereParameterized() to inferParameterized() to correct the spelling and improve readability.

@mohammedhashim790 mohammedhashim790 changed the title Refactor Code Smell Detectors and Resolve Code Issues Refactored Code Smell Detectors and Resolve Code Issues Mar 20, 2025
@mohammedhashim790 mohammedhashim790 changed the title Refactored Code Smell Detectors and Resolve Code Issues Refactored Code Smell Detectors and Resolved Code Issues Mar 20, 2025
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