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: Moves configuration creation for manifest to separate class #356

Merged
merged 1 commit into from Aug 7, 2018

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Aug 3, 2018

Goal

This changeset is intended to reduce the complexity of the Client class, which is currently 757 SLOC. This is partially achieved by extracting the logic to populate Configuration from the AndroidManifest to a separate class.

Changeset

  • Moves code which populates a configuration object from the AndroidManifest into a separate ConfigFactory class
  • Update test imports to pass build

Tests

Ran unit tests, mazerunner

Review

For the submitter, initial self-review:

  • Commented on code changes inline explain the reasoning behind the approach
  • Reviewed the test cases added for completeness and possible points for discussion
  • A changelog entry was added for the goal of this pull request
  • Check the scope of the changeset - is everything in the diff required for the pull request?
  • This pull request is ready for:
    • Initial review of the intended approach, not yet feature complete
    • Structural review of the classes, functions, and properties modified
    • Final review

For the pull request reviewer(s), this changeset has been reviewed for:

  • Consistency across platforms for structures or concepts added or modified
  • Consistency between the changeset and the goal stated above
  • Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?
  • Usage friction - is the proposed change in usage cumbersome or complicated?
  • Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?
  • Concurrency concerns - if components are accessed asynchronously, what issues will arise
  • Thoroughness of added tests and any missing edge cases
  • Idiomatic use of the language

Moves the creation of Configuration from the AndroidManifest to a separate class. This reduces the
complexity of Client initialisation.
@fractalwrench fractalwrench requested a review from a team August 3, 2018 11:04
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 74.906% when pulling ccaec5d on refactor-client-init into 0390356 on next.

Copy link
Contributor

@martin308 martin308 left a comment

Choose a reason for hiding this comment

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

Seems ok to me. I was curious if there are any implications (breaking changes) of changing some of the access modifiers here for external consumers

* @return the updated config
*/
@NonNull
static Configuration populateConfigFromManifest(@NonNull Configuration config,
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the default access modifier that's applied here? Does moving this have any external implications?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The package-level modifier will be applied, so anything with the com.bugsnag.android namespace can access this. I don't believe this has any external implications as I'm not aware of any other notifiers which call this method.

@fractalwrench fractalwrench merged commit 91795d1 into next Aug 7, 2018
@fractalwrench fractalwrench deleted the refactor-client-init branch August 7, 2018 08:17
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.

None yet

3 participants