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

Refactor LicenseFragmentHelper. #8682

Merged

Conversation

Isira-Seneviratne
Copy link
Member

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Make some improvements to LicenseFragmentHelper.

Fixes the following issue(s)

  • Fixes #

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@triallax triallax added the codequality Improvements to the codebase to improve the code quality label Jul 24, 2022
dialog.dismiss()
}
alertDialog.setNeutralButton(R.string.open_website_license) { _, _ ->
}.setNeutralButton(R.string.open_website_license) { _, _ ->
Copy link
Member

Choose a reason for hiding this comment

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

I would keep this on a new line, IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, I don't believe the default parameter commit is particularly useful.

It allows the method overload to be removed.

Copy link
Member

Choose a reason for hiding this comment

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

I'm aware, it's just that IMO it didn't really do anything useful here, considering that both showLicense have different block arguments for the "backend" showLicense's AlertDialog. I think the previous one is simpler to read, even if it makes the class have a few more lines. If it's merged as is, then the block's default parameter (with its arguments) is just overridden by the block arguments set in showLicense(Context, SoftwareComponent). I do understand the reasoning behind it, I just think that it makes it overall harder to interpret.

I can't explain very well right now, my brain is kinda fried.

@@ -1,3 +1,5 @@
@file:JvmName("LicenseFragmentHelper")
Copy link
Member

Choose a reason for hiding this comment

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

None of these are used in Java, so I don't believe we need this.

@TacoTheDank
Copy link
Member

Also, I don't believe the default parameter commit is particularly useful.

@Isira-Seneviratne Isira-Seneviratne force-pushed the Refactor_LicenseFragmentHelper branch 3 times, most recently from 5e193c1 to 779f591 Compare July 30, 2022 01:22
@Isira-Seneviratne Isira-Seneviratne force-pushed the Refactor_LicenseFragmentHelper branch 2 times, most recently from 5345652 to 231785b Compare August 1, 2022 03:03
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Tested, works, thanks. The build was failing because of ktlint, I fixed that.

@Stypox Stypox force-pushed the Refactor_LicenseFragmentHelper branch from 231785b to 4b7de86 Compare August 4, 2022 09:18
@Stypox Stypox merged commit 5640365 into TeamNewPipe:dev Aug 4, 2022
@sonarcloud
Copy link

sonarcloud bot commented Aug 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Isira-Seneviratne Isira-Seneviratne deleted the Refactor_LicenseFragmentHelper branch August 4, 2022 23:31
@Stypox Stypox mentioned this pull request Aug 27, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants