yashketkar/video-player

View on GitHub

Showing 144 of 144 total issues

File MediaPlayer.java has 976 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2006 The Android Open Source Project
 * Copyright (C) 2013 YIXIA.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 2 days to fix

    MediaPlayer has 115 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @SuppressLint("NewApi")
    public class MediaPlayer {
      public static final int CACHE_TYPE_NOT_AVAILABLE = 1;
      public static final int CACHE_TYPE_START = 2;
      public static final int CACHE_TYPE_UPDATE = 3;
    Severity: Major
    Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 2 days to fix

      File VideoView.java has 642 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Copyright (C) 2006 The Android Open Source Project
       * Copyright (C) 2013 YIXIA.COM
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
      Severity: Major
      Found in vitamio/src/io/vov/vitamio/widget/VideoView.java - About 1 day to fix

        VideoView has 69 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class VideoView extends SurfaceView implements MediaController.MediaPlayerControl {
            public static final int VIDEO_LAYOUT_ORIGIN = 0;
            public static final int VIDEO_LAYOUT_SCALE = 1;
            public static final int VIDEO_LAYOUT_STRETCH = 2;
            public static final int VIDEO_LAYOUT_ZOOM = 3;
        Severity: Major
        Found in vitamio/src/io/vov/vitamio/widget/VideoView.java - About 1 day to fix

          Method getFeature has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
          Open

              public static int getFeature() {
                  if (cachedFeature > 0)
                      return getCachedFeature();
          
                  cachedFeature = FEATURE_ARM_V5TE;
          Severity: Minor
          Found in vitamio/src/io/vov/vitamio/utils/CPU.java - About 1 day 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 process has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
          Open

                  public boolean process(byte[] input, int offset, int len, boolean finish) {
                      // Using local variables makes the encoder about 9% faster.
                      final byte[] alphabet = this.alphabet;
                      final byte[] output = this.output;
                      int op = 0;
          Severity: Minor
          Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 7 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 process has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

                  public boolean process(byte[] input, int offset, int len, boolean finish) {
                      if (this.state == 6) return false;
          
                      int p = offset;
                      len += offset;
          Severity: Minor
          Found in vitamio/src/io/vov/vitamio/utils/Base64.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 getThumbnail has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

              static Bitmap getThumbnail(Context ctx, ContentResolver cr, long origId, long groupId, int kind, BitmapFactory.Options options, Uri baseUri) {
                Bitmap bitmap = null;
                MiniThumbFile thumbFile = MiniThumbFile.instance(baseUri);
                long magic = thumbFile.getMagic(origId);
                if (magic != 0) {
          Severity: Minor
          Found in vitamio/src/io/vov/vitamio/provider/MediaStore.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 handleMessage has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public void handleMessage(Message msg) {
                if (mMediaPlayer == null) {
          //        //Log.i("MiuiVideo: get message after player released, msg type: " + msg.what);
                  return;
          Severity: Minor
          Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 5 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

          File Base64.java has 380 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Copyright (C) 2010 The Android Open Source Project
           *
           * Licensed under the Apache License, Version 2.0 (the "License");
           * you may not use this file except in compliance with the License.
          Severity: Minor
          Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 5 hrs to fix

            File MediaScanner.java has 374 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright (C) 2006 The Android Open Source Project
             * Copyright (C) 2013 YIXIA.COM
             *
             * Licensed under the Apache License, Version 2.0 (the "License");
            Severity: Minor
            Found in vitamio/src/io/vov/vitamio/MediaScanner.java - About 5 hrs to fix

              Method process has 117 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public boolean process(byte[] input, int offset, int len, boolean finish) {
                          if (this.state == 6) return false;
              
                          int p = offset;
                          len += offset;
              Severity: Major
              Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 4 hrs to fix

                File MediaController.java has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 * Copyright (C) 2006 The Android Open Source Project
                 * Copyright (C) 2013 YIXIA.COM
                 *
                 * Licensed under the Apache License, Version 2.0 (the "License");
                Severity: Minor
                Found in vitamio/src/io/vov/vitamio/widget/MediaController.java - About 4 hrs to fix

                  Method parse has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public boolean parse(Map<byte[], byte[]> meta, String encoding) {
                      String key = null;
                      byte[] value = null;
                      mEncoding = encoding;
                      for (byte[] keyBytes : meta.keySet()) {
                  Severity: Minor
                  Found in vitamio/src/io/vov/vitamio/Metadata.java - About 4 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 process has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public boolean process(byte[] input, int offset, int len, boolean finish) {
                              // Using local variables makes the encoder about 9% faster.
                              final byte[] alphabet = this.alphabet;
                              final byte[] output = this.output;
                              int op = 0;
                  Severity: Major
                  Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 4 hrs to fix

                    MediaController has 30 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class MediaController extends FrameLayout {
                      private static final int sDefaultTimeout = 3000;
                      private static final int FADE_OUT = 1;
                      private static final int SHOW_PROGRESS = 2;
                      private MediaPlayerControl mPlayer;
                    Severity: Minor
                    Found in vitamio/src/io/vov/vitamio/widget/MediaController.java - About 3 hrs to fix

                      Method parse has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public boolean parse(Map<byte[], byte[]> meta, String encoding) {
                          String key = null;
                          byte[] value = null;
                          mEncoding = encoding;
                          for (byte[] keyBytes : meta.keySet()) {
                      Severity: Major
                      Found in vitamio/src/io/vov/vitamio/Metadata.java - About 3 hrs to fix

                        Method onPrepared has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public void onPrepared(MediaPlayer mp) {
                              Log.d("onPrepared");
                                    mCurrentState = STATE_PREPARED;
                                    // mTargetState = STATE_PLAYING;
                        
                        
                        Severity: Minor
                        Found in vitamio/src/io/vov/vitamio/widget/VideoView.java - About 3 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 getFeature has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static int getFeature() {
                                if (cachedFeature > 0)
                                    return getCachedFeature();
                        
                                cachedFeature = FEATURE_ARM_V5TE;
                        Severity: Major
                        Found in vitamio/src/io/vov/vitamio/utils/CPU.java - About 3 hrs to fix

                          Method handleMessage has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @Override
                              public void handleMessage(Message msg) {
                                if (mMediaPlayer == null) {
                          //        //Log.i("MiuiVideo: get message after player released, msg type: " + msg.what);
                                  return;
                          Severity: Major
                          Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language