berict/Tapad

View on GitHub

Showing 231 of 426 total issues

Method setAdapter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void setAdapter() {
        if (isPresetDownloading) {
            // attach adapter while its not null
            presetStoreAdapter = new PresetStoreAdapter(
                    online,

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 setLoadingFinished has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setLoadingFinished(boolean isFinished) {
        if (isFinished) {
            // finished, hide loading and show recyclerView
            Log.d(TAG, "setLF(true)");
            anim.fadeOut(recyclerViewLoading, 0, 200, a);

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 setPadColorToDefault has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    void setPadColorToDefault(boolean isForced) {
        if (isForced && view != null) {
            // forced change
            setPadColor(colorDef);
        } else {
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/model/sound/Pad.java - About 25 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

Method cancel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        void cancel() {
            isPresetDownloading = false;
            if (item != null) {
                item.setBytesTransferred(-1);
                item.setTotalByteCount(-1);
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 25 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

Method onCreate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);

Severity: Minor
Found in app/src/main/java/com/bedrock/padder/activity/AboutActivity.java - About 25 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

Method setUi has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void setUi() {
        // status bar
        activity.findViewById(R.id.status_bar).setBackgroundColor(about.getColor());

        if (about == null) {
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/activity/AboutActivity.java - About 25 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

Method checkVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void checkVersion() {
        try {
            currentVersionCode = a.getPackageManager().getPackageInfo(a.getPackageName(), 0).versionCode;
            Log.i("versionCode", "versionCode retrieved = " + String.valueOf(currentVersionCode));
        } catch (android.content.pm.PackageManager.NameNotFoundException e) {
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 25 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

Method setRecentColor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setRecentColor(int titleId, int color, Activity activity) {
        if (Build.VERSION.SDK_INT >= 21) {
            if (titleId == 0) {
                // Default app name
                titleId = R.string.app_name;
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/helper/WindowHelper.java - About 25 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

Method setRecentColor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setRecentColor(int titleId, int iconId, int color, Activity activity) {
        if (Build.VERSION.SDK_INT >= 21) {
            if (titleId == 0) {
                // Default app name
                titleId = R.string.app_name;
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/helper/WindowHelper.java - About 25 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

Method setRecentColor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setRecentColor(String title, int iconId, int color, Activity activity) {
        if (Build.VERSION.SDK_INT >= 21) {
            if (title == null) {
                // Default app name
                title = activity.getResources().getString(R.string.app_name);
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/helper/WindowHelper.java - About 25 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

Method clear has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void clear() {
        // clear buttons
        for (Deck deck : decks) {
            for (Pad pad : deck.getPads()) {
                if (pad != null) {
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/helper/SoundHelper.java - About 25 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

Severity
Category
Status
Source
Language