CodeNarc - CodeNarc - Braces Rules

##### General

- Home
- Downloads
- Javadocs
- Mailing Lists
- Bug Tracker
- SourceForge Project
- GitHub Project

##### Running

- Ant Task Usage
- Command-Line
- Run as a Test
- Other Tools/Frameworks

##### Using

- Creating a RuleSet
- Creating a Rule
- Configuring Rules
- Starter RuleSet (All)

##### Report Types

- HTML Report
- XML Report
- Text and IDE Reports

##### Sample Reports

- Sample HTML Report
- Sample XML Report

##### Rules

- Rule Index
- Basic Rules
- Braces Rules
- Concurrency Rules
- Convention Rules
- Design Rules
- DRY Rules
- Enhanced Rules
- Exceptions Rules
- Formatting Rules
- Generic Rules
- Grails Rules
- Groovyism Rules
- Imports Rules
- JDBC Rules
- JUnit Rules
- Logging Rules
- Naming Rules
- Size/Complexity Rules
- Security Rules
- Serialization Rules
- Unnecessary Rules
- Unused Rules

##### Developing

- Developer Guide

##### Project Documentation

- Project Information
- Project Reports

## Braces Rules ("rulesets/braces.xml")

### ElseBlockBraces Rule

Checks that else blocks use braces, even for a single statement.

By default, braces are not required for an else if it is followed immediately by an if. Set the bracesRequiredForElseIf property to true to require braces is that situation as well.

Property | Description | Default Value
bracesRequiredForElseIf | Set to `true` to require braces for an else block followed immediately by an if statement. | `false`

### ForStatementBraces Rule

Checks that for statements use braces, even for a single statement.

### IfStatementBraces Rule

Checks that if statements use braces, even for a single statement.

### WhileStatementBraces Rule

Checks that while statements use braces, even for a single statement.