Skip to content

Merge master to features/embeddedJson#29627

Merged
14 commits merged intofeatures/embeddedJsonfrom
merges/master-to-features/embeddedJson
Sep 4, 2018
Merged

Merge master to features/embeddedJson#29627
14 commits merged intofeatures/embeddedJsonfrom
merges/master-to-features/embeddedJson

Conversation

@dotnet-bot
Copy link
Copy Markdown
Collaborator

This is an automatically generated pull request from master into features/embeddedJson.

git fetch --all
git checkout merges/master-to-features/embeddedJson
git reset --hard upstream/features/embeddedJson
git merge upstream/master
# Fix merge conflicts
git commit
git push merges/master-to-features/embeddedJson --force

Once all conflicts are resolved and all the tests pass, you are free to merge the pull request.

mavasani and others added 14 commits August 24, 2018 11:33
…methods/properties/events)

Analyzer flags two cases: members with no read/writes and members with only writes.

1. Members with no read or writes: `Type '{0}' has an unused private member '{1}' which can be removed.`
2. Only writes: `Type '{0}' has a private member '{1}' which can be removed as the value assigned to it is never used.`

Code fix removes the unused member declaration.
Fixes #24225

Open questions:
1. Current analyzer design uses a single code style option for all members and both the above kinds of unused members. We can potentially have multiple options, but this should probably be done based on feedback.
2. Should the analyzer use different diagnostic IDs for the above two kinds of unused members? This will mean that the FixAll experience will need multiple iterations for removing unused members.
3. Should we update the code fix (or have an additional code fix) that also updates the write references for the case (2) above? Or is it better to leave the references to break the code so the user can analyze if the value being assigned can also be removed. The PR current chooses the latter approach as it is more conservative and unlikely to cause silent breaks.
1. Break the analyzer into two separate diagnostics for flagging unused and unread members. Latter rule has no code fix.
2. Remove all UI option elements for the added diagnostics and turn the rules off by default for now.
3. Bail out for invalid operations and syntax errors.
4. Handle doc comments and nameof - report unread member diagostics instead of unused member diagnostics if referenced in non-read/write context.
…mber for fields with non-constant initializers.
[DeadCodeAnalysis] Add analyzer/fixer to flag and remove unused private members (fields/…
Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approval

@ghost ghost merged commit 9c528c4 into features/embeddedJson Sep 4, 2018
@ghost ghost deleted the merges/master-to-features/embeddedJson branch September 4, 2018 04:00
@dotnet-bot dotnet-bot restored the merges/master-to-features/embeddedJson branch September 4, 2018 12:00
@dotnet-bot dotnet-bot deleted the merges/master-to-features/embeddedJson branch September 4, 2018 12:00
@dotnet-bot dotnet-bot restored the merges/master-to-features/embeddedJson branch September 5, 2018 00:00
@dotnet-bot dotnet-bot deleted the merges/master-to-features/embeddedJson branch September 5, 2018 00:00
@dotnet-bot dotnet-bot restored the merges/master-to-features/embeddedJson branch September 5, 2018 12:00
@dotnet-bot dotnet-bot deleted the merges/master-to-features/embeddedJson branch September 5, 2018 12:00
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants