Skip to content

Instantly share code, notes, and snippets.

Created December 2, 2011 10:26
Coding Standard Violations for hale-aloha-cli-cycuc
EJS-07: Include white space.
There is a lack of whitespace in the test methods of TestRankTowers, TestDailyEnergy, and TestCurrentPower.
EJS-13: Capitalize only the first letter in acronyms.
HaleAlohaClientUI class capitalizes "UI" instead of only capitalizing the first letter. Admittedly, "HaleAlohaClientUi" might have been confusing to read.
EJS-29: Qualify field variables with "this" to distinguish them from local variables
In HaleAlohaClientUI:
HaleAlohaClientUI:
prompt (line 66)
isFinished:
finished (line 27)
promptForOperation:
scanner (line 130)
In Operation:
getString:
string (line 35)
In CurrentPower:
getPowerConsumed:
powerConsumed (line 24)
In DailyEnergy:
printResults:
energy (line 44)
In TestProcessor:
testGetSource:
processor (lines 37, 47, 59, 60, 75, 80, 81)
EJS-30: When a constructor or "set" method assigns a parameter to a field, give that parameter the same name as the field.
In Processor:
setSource (line 135)
setTimestamp (line 81)
Note though that in both of these cases the methods are not actually setting the field to the parameter value.
EJS-31: Use uppercase letters for each word and separate each pair of words with an underscore when naming constants.
In HaleAlohaClientUI:
prompt (line 34)
In Operation:
quit (line 10)
help (line 12)
currentPower (line 14)
dailyEnergy (line 16)
energySince (line 18)
rankTowers (line 20)
EJS-33: Keep comments and code in sync.
In HaleAlohaClientUI:
"When we have the processor class implemented..." (lines 38-39)
The Processor class is already implemented as of this writing.
EJS-35: Use documentation comments to describe the programming interface.
In HaleAlohaClientUI:
JavaDoc comments were used repeatedly where single-line comments would have been preferable.
EJS-53: Provide a summary description for each class, interface, field, and method.
In HaleAlohaClientUI:
isFinished (line 26)
In DailyEnergy:
getEnergy (line 48)
In EnergySince:
getEnergy (line 49)
In RankTowers:
rankTow (line 56)
In Processor:
getTimestamp (line 179)
getBeginningTimestamp (line 187)
getEndTimestamp (line 195)
ICS-SE-Java-6: Format JavaDoc summary lines correctly.
In TestDailyEnergy:
test (line 22)
The first "sentence" in the JavaDoc documentation is "1." This does not adequately describe the method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment