davidmigloz/go-bees

View on GitHub
app/src/main/java/com/davidmiguel/gobees/apiary/ApiaryInfoFragment.java

Summary

Maintainability
A
3 hrs
Test Coverage

Method showInfo has 44 lines of code (exceeds 25 allowed). Consider refactoring.
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

        @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

          @SuppressWarnings("ConstantConditions")
          @Override
          public void showInfo(Apiary apiary, Date lastRevisionDate) {
              // GENERAL INFO
              // Location
      Severity: Minor
      Found in app/src/main/java/com/davidmiguel/gobees/apiary/ApiaryInfoFragment.java - About 55 mins to fix

      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

              ScrollView info = (ScrollView) root.findViewById(R.id.info);

      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.

      There are no issues that match your filters.

      Category
      Status