milosmns/silly-android

View on GitHub

Showing 36 of 92 total issues

Preconditions has 84 methods (exceeds 20 allowed). Consider refactoring.
Open

@SuppressWarnings({"unused", "WeakerAccess"})
public final class Preconditions {

    private Preconditions() {}

    File Preconditions.java has 560 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package me.angrybyte.sillyandroid.extras;
    
    /*
     * Copyright (C) 2007 The Guava Authors
     *

      File DialogManagerImpl.java has 351 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package me.angrybyte.sillyandroid.dialogs;
      
      import android.app.Dialog;
      import android.os.Bundle;
      import android.os.Parcel;

        DialogManagerImpl has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class DialogManagerImpl implements DialogManager {
        
            private static final String TAG = DialogManagerImpl.class.getSimpleName();
        
            static final class DialogInfo implements Parcelable {

          File EasyFragment.java has 272 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          package me.angrybyte.sillyandroid.components;
          
          import android.Manifest;
          import android.annotation.TargetApi;
          import android.app.Activity;

            Method recreateFromConfigs has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                private void recreateFromConfigs(@NonNull final Collection<DialogInfo> configs, boolean showNow) {
                    clearAllMappings();
                    for (DialogInfo iDialogInfo : configs) {
                        if (!iDialogInfo.isFragment) {
                            final Dialog created = createDialog(iDialogInfo.id, iDialogInfo.config);

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

                @Nullable
                @Override
                @CallSuper
                public View onCreateView(@NonNull final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) {
                    final Context fragmentContext = getContext();

            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 onClick has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                public void onClick(final View v) {
                    super.onClick(v);
                    switch (v.getId()) {
                        case R.id.button_print_info: {
            Severity: Minor
            Found in demo/src/main/java/me/angrybyte/sillyandroid/demo/MainActivity.java - About 1 hr to fix

              Method checkNotNull has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                          T obj,
                          @Nullable String errorMessageTemplate,
                          @Nullable Object p1,
                          @Nullable Object p2,
                          @Nullable Object p3,

                Method checkArgument has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                            boolean b,
                            @Nullable String errorMessageTemplate,
                            @Nullable Object p1,
                            @Nullable Object p2,
                            @Nullable Object p3,

                  Method checkState has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              boolean b,
                              @Nullable String errorMessageTemplate,
                              @Nullable Object p1,
                              @Nullable Object p2,
                              @Nullable Object p3,

                    Method createContrastStateDrawable has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static StateListDrawable createContrastStateDrawable(@NonNull final Context context, @ColorInt final int normalColor, @ColorInt final int
                                pressedBackColor,
                                                                                    final boolean shouldFade, @NonNull final Drawable original) {

                      Method setPadding has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          protected final void setPadding(@NonNull final View view, @Px final int start, @Px final int top, @Px final int end, @Px final int bottom) {

                        Method checkArgument has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                    boolean b,
                                    @Nullable String errorMessageTemplate,
                                    @Nullable Object p1,
                                    @Nullable Object p2,
                                    @Nullable Object p3) {

                          Method checkState has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                      boolean b,
                                      @Nullable String errorMessageTemplate,
                                      @Nullable Object p1,
                                      @Nullable Object p2,
                                      @Nullable Object p3) {

                            Method setPadding has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public static void setPadding(@NonNull final View view, @Px final int start, @Px final int top, @Px final int end, @Px final int bottom) {
                            Severity: Minor
                            Found in sillyandroid/src/main/java/me/angrybyte/sillyandroid/SillyAndroid.java - About 35 mins to fix

                              Method checkNotNull has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                          T obj,
                                          @Nullable String errorMessageTemplate,
                                          @Nullable Object p1,
                                          @Nullable Object p2,
                                          @Nullable Object p3) {

                                Method setPadding has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    protected final void setPadding(@NonNull final View view, @Px final int start, @Px final int top, @Px final int end, @Px final int bottom) {

                                  Method setPadding has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      protected final void setPadding(@NonNull final View view, @Px final int start, @Px final int top, @Px final int end, @Px final int bottom) {

                                    Method unhideAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        @Override
                                        public void unhideAll() {
                                            for (Dialog iDialog : mDialogInstances.values()) {
                                                if (!iDialog.isShowing()) {
                                                    iDialog.show();

                                    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