Skip to content
| Marketplace
Sign in
Visual Studio>Tools>(Code Smell) Single Statement If Block
(Code Smell) Single Statement If Block

(Code Smell) Single Statement If Block

AdamSpeight2008

|
325 installs
| (0) | Free
("Roslyn" D+CF) Transforms a single statement If Block (If {cond} Then {statement} End If) into a single line (If {cond} Then {statement}).
Download

CodeSmell  (Single Statement If Block -> Single Line IF Statement)

 

This code diagnostic analyser and codefix provider, highlights the sections of you Visual Basic code that code replace with a single line If statement.

Example

 

Visual Basic
Edit|Remove
vb
If boolean_condition Then   codeEnd If
If boolean_condition Then    code End If
  rewritten as
Visual Basic
Edit|Remove
vb
If boolean_condition Then code
If boolean_condition Then code
Reducing the number of lines of code by two, for each instance.

 

Before

 

Preview

 

After

 

Note: This tool is still undevelopment, so usage is at your own risk. 

If through usage you find that it generates bad suggestions, please could you inform me so I can improve the tool. 

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft