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

Duplicate interface and class for Segment #2004

Closed
ckcherry23 opened this issue May 11, 2023 · 0 comments · Fixed by #2085
Closed

Duplicate interface and class for Segment #2004

ckcherry23 opened this issue May 11, 2023 · 0 comments · Fixed by #2085

Comments

@ckcherry23
Copy link
Member

ckcherry23 commented May 11, 2023

What feature(s) would you like to see in RepoSense

There is currently an AuthorshipFileSegment interface in types/types.ts and a Segment class in utils/Segment.ts. However, as the interface and the class are mostly equivalent, it will be reasonable to remove either of them.

Is the feature request related to a problem?

The interchangeable usage of the Segment Interface and class implies possible inconsistency.

If possible, describe the solution

Remove either the interface or the class and replace all usages of the removed construct. Removing the class seems to have more advantages considering the runtime.

If applicable, describe alternatives you've considered

Removing the interface may also be reasonable as it may allow more flexibility with class methods in a future context.

Additional context

Discussed in #1969 and #1965.

@ckcherry23 ckcherry23 moved this to For contributors in RepoSense Roadmap May 11, 2023
@jonasongg jonasongg self-assigned this Jan 20, 2024
ckcherry23 pushed a commit that referenced this issue Jan 26, 2024
Remove Segment class, replace with AuthorshipFileSegment

The Segment class and AuthorshipFileSegment interface are equivalent in
their usage and their redundancy seems to be a remnant when the code
was migrated from JS to TS.

Let's remove the Segment class for consistency and to improve runtime
performance.
@github-project-automation github-project-automation bot moved this from For contributors to Closed/Completed in RepoSense Roadmap Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed/Completed
Development

Successfully merging a pull request may close this issue.

2 participants