Skip to content

CC0124 Replace if statement or operator with call to Math.Max #799

@kwhitefoot

Description

@kwhitefoot

New analyzer:

Replace if statement or operator with call to Math.Max.

Max is easier to read and quite often shorter.

Before:

     a = If(b >= c, b, c) 

After:

  a = Math.Max(b, c)

You can add more information here, e.g. conditions under which a diagnostic should not trigger, etc.

Diagnostic Id: CC0124
Category: Maintainability
Severity: Info

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions