Skip to content

C#: Fix some LGTM alerts on the extractor#755

Merged
hvitved merged 4 commits into
github:masterfrom
calumgrant:cs/extractor-alerts
Jan 14, 2019
Merged

C#: Fix some LGTM alerts on the extractor#755
hvitved merged 4 commits into
github:masterfrom
calumgrant:cs/extractor-alerts

Conversation

@calumgrant

Copy link
Copy Markdown
Contributor

No description provided.

@calumgrant calumgrant added the C# label Jan 11, 2019
@calumgrant calumgrant requested a review from hvitved January 11, 2019 12:48
@calumgrant calumgrant requested a review from a team as a code owner January 11, 2019 12:48
@pavgust

pavgust commented Jan 11, 2019

Copy link
Copy Markdown
Contributor

This pull request fixes 5 alerts when merging de4f592 into b0dd3df - view on LGTM.com

fixed alerts:

  • 3 for Dereferenced variable may be null
  • 1 for Redundant ToString() call
  • 1 for Reference equality test on System.Object

Comment posted by LGTM.com

@hvitved hvitved left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just two comments.

{
var other = obj as CachedEntity<Initializer>;
return obj != null && obj.GetType() == GetType() && Equals(other.symbol, symbol);
return other != null && other.GetType() == GetType() && Equals(other.symbol, symbol);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could replace other != null && other.GetType() == GetType() with other?.GetType() == GetType()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

}
}
catch (Exception ex)
catch (Exception ex) // lgtm[cs/catch-of-all-exceptions]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps we should disable this query in the .lgtm.yml file instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think leave this, because it would be in principle a good idea to receive new alerts for cs/catch-of-all-exceptions if we introduce new ones.

@pavgust

pavgust commented Jan 11, 2019

Copy link
Copy Markdown
Contributor

This pull request fixes 4 alerts when merging e76eb16 into dcdbc00 - view on LGTM.com

fixed alerts:

  • 2 for Dereferenced variable may be null
  • 1 for Redundant ToString() call
  • 1 for Reference equality test on System.Object

Comment posted by LGTM.com

@hvitved hvitved merged commit bbc49dc into github:master Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants