IfElseSameCheck

Checks for duplicated code in conditional and logical expressions.

  • If statements whose "then" block is the same as the "else" block
  • || and && expressions where the left and right are the same
  • == expressions where the left and right are the same

Constructors

this
this(string fileName, const(Scope)* sc)
Undocumented in source.

Members

Aliases

visit
alias visit = BaseAnalyzer.visit
Undocumented in source.

Functions

visit
void visit(IfStatement ifStatement)
Undocumented in source. Be warned that the author may not have intended to support it.
visit
void visit(AssignExpression assignExpression)
Undocumented in source. Be warned that the author may not have intended to support it.
visit
void visit(AndAndExpression andAndExpression)
Undocumented in source. Be warned that the author may not have intended to support it.
visit
void visit(OrOrExpression orOrExpression)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From BaseAnalyzer

messages
Message[] messages()
Undocumented in source. Be warned that the author may not have intended to support it.
inAggregate
bool inAggregate;
Undocumented in source.
visitTemplate
template visitTemplate(T)
Undocumented in source.
addErrorMessage
void addErrorMessage(size_t line, size_t column, string key, string message)
Undocumented in source. Be warned that the author may not have intended to support it.
fileName
string fileName;

The file name

sc
const(Scope)* sc;
Undocumented in source.
_messages
MessageSet _messages;
Undocumented in source.

Meta