Extract and Override
How Much Code To Extract?
There were only three direct calls to
RiskAssessor
. Why then did you also include the
next two lines in getAmountAtRisk()
? - Collaboration aside, that paragraphing comment "get risk assessment" is an instance of the Comment code smell. It's telling us what the code does, instead of calling a method named accordingly. That would usually have us extract a method.
- After retrieving data from
RiskAssessor
, the code only produces a simple multiply. We're pretty confident that multiplication works.
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |