SmashKs/OneShoot

View on GitHub
presentation/src/main/java/smash/ks/com/oneshoot/widgets/blur/RealtimeBlurView.java

Summary

Maintainability
D
1 day
Test Coverage

Method prepare has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    protected boolean prepare() {
        if (mBlurRadius == 0) {
            release();
            return false;
        }

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

File RealtimeBlurView.java has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2018 The Smash Ks Open Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.

    Method prepare has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected boolean prepare() {
            if (mBlurRadius == 0) {
                release();
                return false;
            }

      Method onPreDraw has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              @Override
              public boolean onPreDraw() {
                  int[] locations = new int[2];
                  Bitmap oldBmp = mBlurredBitmap;
                  View decor = mDecorView;

        Method onPreDraw has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

                @Override
                public boolean onPreDraw() {
                    int[] locations = new int[2];
                    Bitmap oldBmp = mBlurredBitmap;
                    View decor = mDecorView;

        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

        Avoid too many return statements within this method.
        Open

                            return false;

          Avoid too many return statements within this method.
          Open

                  return true;

            There are no issues that match your filters.

            Category
            Status