hackedteam/core-android-market

View on GitHub
src/main/java/org/benews/DetailFragViewImage.java

Summary

Maintainability
C
1 day
Test Coverage

Method onActivityCreated has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        if (item_path != null && item_type != null) {
            if (item_type.equals(BeNewsArrayAdapter.TYPE_IMG_DIR)) {
Severity: Minor
Found in src/main/java/org/benews/DetailFragViewImage.java - About 6 hrs 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

Method onActivityCreated has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        if (item_path != null && item_type != null) {
            if (item_type.equals(BeNewsArrayAdapter.TYPE_IMG_DIR)) {
Severity: Minor
Found in src/main/java/org/benews/DetailFragViewImage.java - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                                if (h > it_M || h < it_m)
                                    myBitmap = BitmapHelper.scaleToFitHeight(myBitmap, (int) ((BitmapHelper.dp2dpi_factor == 0) ? 200 : 200 * BitmapHelper.dp2dpi_factor));
    Severity: Major
    Found in src/main/java/org/benews/DetailFragViewImage.java - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status