app/src/main/java/com/davidmiguel/gobees/apiary/ApiaryInfoFragment.java
Method showInfo
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("ConstantConditions")
@Override
public void showInfo(Apiary apiary, Date lastRevisionDate) {
// GENERAL INFO
// Location
Method onCreateView
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.apiary_info_frag, container, false);
Method showInfo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
@SuppressWarnings("ConstantConditions")
@Override
public void showInfo(Apiary apiary, Date lastRevisionDate) {
// GENERAL INFO
// Location
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Distance between variable 'info' declaration and its first usage is 19, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value). Open
Open
ScrollView info = (ScrollView) root.findViewById(R.id.info);
- Read upRead up
- Exclude checks
Checks the distance between declaration of variable and its first usage.Note : Variable declaration/initialization statements are not countedwhile calculating length.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.