jumaallan/AndelaCryptoApp

View on GitHub

Showing 36 of 56 total issues

File InkPageIndicator.java has 640 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.androidstudy.andelatrackchallenge.widget;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;

    File Easel.java has 370 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.androidstudy.andelatrackchallenge.utils;
    
    /**
     * Created by anonymous on 11/2/17.
     */

      Method getUnselectedPath has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private Path getUnselectedPath(int page,
                                         float centerX,
                                         float nextCenterX,
                                         float joiningFraction,
                                         float dotRevealFraction) {

        Easel has 33 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class Easel {
        
            /**
             * Get a darker version of the specified color (10% darker)
             *

          InkPageIndicator has 32 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class InkPageIndicator extends View implements ViewPager.OnPageChangeListener,
                  View.OnAttachStateChangeListener {
          
              // defaults
              private static final int DEFAULT_DOT_SIZE = 8;                      // dp

            File CardsAdapter.java has 314 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package com.androidstudy.andelatrackchallenge.adapter;
            
            import android.animation.Animator;
            import android.animation.AnimatorListenerAdapter;
            import android.content.Context;

              Method updateBackground has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void updateBackground(int position, float positionOffset) {
                      @ColorInt
                      int background;
                      @ColorInt
                      int backgroundNext;

                Method getFlagRes has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @DrawableRes
                    public int getFlagRes() {
                        switch (code) {
                            case "USD":
                                return R.drawable.flag_us;

                  Method updateBackground has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void updateBackground(int position, float positionOffset) {
                          @ColorInt
                          int background;
                          @ColorInt
                          int backgroundNext;

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

                      @Override
                      public boolean equals(Object o) {
                          if (this == o) return true;
                          if (o == null || getClass() != o.getClass()) 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

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

                      public static Single<Country> loadRate(Country oldCountry) {
                          long minutesBefore = System.currentTimeMillis() - (10 * 60 * 1000);
                          if (oldCountry.refreshedAt > minutesBefore)
                              return Single.error(new Throwable("No refresh needed!"));
                  
                  

                    Method finishSetup has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void finishSetup() {
                            starImage.setVisibility(country.isFavorite ? View.VISIBLE : View.GONE);
                            cryptoEdit.setEnabled(true);
                            currencyEdit.setEnabled(true);
                            cryptoEdit.setSelection(cryptoEdit.getText().length());

                      Method setSelectedPage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private void setSelectedPage(int now) {
                              if (now == currentPage || dotCenterX == null || dotCenterX.length <= now) return;
                      
                              pageChanging = true;
                              previousPage = currentPage;

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

                          private ValueAnimator createMoveSelectedAnimator(
                                  final float moveTo, int was, int now, int steps) {
                      
                              // create the actual move animator
                              ValueAnimator moveSelected = ValueAnimator.ofFloat(selectedDotX, moveTo);

                        Method tint has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static void tint(@NonNull ProgressBar progressBar, @ColorInt int color, boolean skipIndeterminate) {
                                ColorStateList sl = ColorStateList.valueOf(color);
                                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                    progressBar.setProgressTintList(sl);
                                    progressBar.setSecondaryProgressTintList(sl);

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

                            public static void tint(@NonNull SeekBar seekBar, @ColorInt int color) {
                                ColorStateList s1 = ColorStateList.valueOf(color);
                                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                    seekBar.setThumbTintList(s1);
                                    seekBar.setProgressTintList(s1);

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

                            private Path getUnselectedPath(int page,
                                                           float centerX,
                                                           float nextCenterX,
                                                           float joiningFraction,
                                                           float dotRevealFraction) {

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

                            private void logout() {
                                if (!Settings.isLoggedIn()) {
                                    return;
                                }
                        
                        

                          Method showEmptyView has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private void showEmptyView(boolean show) {
                                  if (emptyView != null) {
                                      if (show) {
                                          emptyView.setVisibility(View.VISIBLE);
                                          emptyView.setAlpha(0.0f);

                            Method onCreate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                protected void onCreate(@Nullable Bundle savedInstanceState) {
                                    super.onCreate(savedInstanceState);
                                    setContentView(R.layout.activity_calculator);
                                    ButterKnife.bind(this);
                              Severity
                              Category
                              Status
                              Source
                              Language