Skip to content

Empty statement (EmptyStatement)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Code smell BSL
OS
Info Yes 1 badpractice

Description

An empty statement is an operator consisting only of a semicolon (";"). Usually appears when:

  • refactoring, when the developer deleted a part of the code, but forgot to delete the last ";"
  • "copy paste", when the developer pasted the copied code containing the final character ";"
  • inattentive, when the developer twice (or even more) times clicked the symbol ";"

An empty statement does not lead to code errors, but clutters it, reducing perception.

Snippets

Diagnostic ignorance in code

// BSLLS:EmptyStatement-off
// BSLLS:EmptyStatement-on

Parameter for config

"EmptyStatement": false