yashketkar/video-player

View on GitHub

Showing 108 of 144 total issues

Method getMagic has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  protected synchronized long getMagic(long id) {
    RandomAccessFile r = miniThumbDataFile();
    if (r != null) {
      long pos = id * BYTES_PER_MINTHUMB;
      FileLock lock = null;
Severity: Minor
Found in vitamio/src/io/vov/vitamio/provider/MiniThumbFile.java - About 1 hr to fix

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

      private SparseArray<MediaFormat> parseTrackInfo(byte[] tracks, String encoding) {
        SparseArray<MediaFormat> trackSparse = new SparseArray<MediaFormat>();
        String trackString;
        int trackNum;
        try {
    Severity: Minor
    Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 55 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 setDataSource has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      public void setDataSource(Context context, Uri uri, Map<String, String> headers) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException {
        if (context == null || uri == null)
          throw new IllegalArgumentException();
        String scheme = uri.getScheme();
        if (scheme == null || scheme.equals("file")) {
    Severity: Minor
    Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 55 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 setDataSource has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      public void setDataSource(Context context, Uri uri) throws IOException, IllegalArgumentException,
          SecurityException, IllegalStateException {
        if (context == null || uri == null)
          throw new IllegalArgumentException();
        String scheme = uri.getScheme();
    Severity: Minor
    Found in vitamio/src/io/vov/vitamio/MediaMetadataRetriever.java - About 55 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 onLayout has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      @Override
      protected void onLayout(boolean changed, int l, int t, int r, int b) {
        int count = getChildCount();
        mWidth = getMeasuredWidth();
        mHeight = getMeasuredHeight();
    Severity: Minor
    Found in vitamio/src/io/vov/vitamio/widget/CenterLayout.java - About 55 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 getMiniThumbFromFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      protected synchronized byte[] getMiniThumbFromFile(long id, byte[] data) {
        RandomAccessFile r = miniThumbDataFile();
        if (r == null)
          return null;
    
    
    Severity: Minor
    Found in vitamio/src/io/vov/vitamio/provider/MiniThumbFile.java - About 55 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 getThumbnail has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        static Bitmap getThumbnail(Context ctx, ContentResolver cr, long origId, long groupId, int kind, BitmapFactory.Options options, Uri baseUri) {
    Severity: Major
    Found in vitamio/src/io/vov/vitamio/provider/MediaStore.java - About 50 mins to fix

      Method setProgress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        private long setProgress() {
          if (mPlayer == null || mDragging)
            return 0;
      
          long position = mPlayer.getCurrentPosition();
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/widget/MediaController.java - About 45 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 saveMiniThumbToFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        protected synchronized void saveMiniThumbToFile(byte[] data, long id, long magic) throws IOException {
          RandomAccessFile r = miniThumbDataFile();
          if (r == null)
            return;
      
      
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/provider/MiniThumbFile.java - About 45 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 onBufferingUpdate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private void onBufferingUpdate(Message msg) {
              int percent = msg.arg1;
              if (mOnBufferingUpdateListener != null)
                  mOnBufferingUpdateListener.onBufferingUpdate(mMediaPlayer, msg.arg1);
              if (percent >= 100 && mInBuffering) {
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 45 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 onError has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean onError(MediaPlayer mp, int framework_err, int impl_err) {
            Log.d("Error: %d, %d", framework_err, impl_err);
            mCurrentState = STATE_ERROR;
            mTargetState = STATE_ERROR;
            if (mMediaController != null)
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/widget/VideoView.java - About 45 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 deleteDir has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static void deleteDir(File f) {
              if (f.exists() && f.isDirectory()) {
                  for (File file : f.listFiles()) {
                      if (file.isDirectory())
                          deleteDir(file);
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/utils/FileUtils.java - About 45 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 hide has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        public void hide() {
          if (mAnchor == null)
            return;
      
          if (mShowing) {
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/widget/MediaController.java - About 45 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 chooseConfig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
            for (EGLConfig config : configs) {
              int d = findConfigAttrib(egl, display, config, EGL10.EGL_DEPTH_SIZE, 0);
              int s = findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0);
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/EGL.java - About 45 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 getThumbnail has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            public static Bitmap getThumbnail(Context ctx, ContentResolver cr, long origId, long groupId, int kind, BitmapFactory.Options options) {
      Severity: Minor
      Found in vitamio/src/io/vov/vitamio/provider/MediaStore.java - About 45 mins to fix

        Method encode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static byte[] encode(byte[] input, int offset, int len, int flags) {
                Encoder encoder = new Encoder(flags, null);
        
                // Compute the exact length of the array we will produce.
                int output_len = len / 3 * 4;
        Severity: Minor
        Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 45 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 onLayout has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          protected void onLayout(boolean changed, int l, int t, int r, int b) {
        Severity: Minor
        Found in vitamio/src/io/vov/vitamio/widget/CenterLayout.java - About 35 mins to fix

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

                      public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
          Severity: Minor
          Found in app/src/main/java/com/yashketkar/ykplayer/ZbigzFragment.java - About 35 mins to fix

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

              private void updateSub(int subType, byte[] bytes, String encoding, int width, int height) {
            Severity: Minor
            Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 35 mins to fix

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

                  private int findConfigAttrib(EGL10 egl, EGLDisplay display, EGLConfig config, int attribute, int defaultValue) {
              Severity: Minor
              Found in vitamio/src/io/vov/vitamio/EGL.java - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language