yashketkar/video-player

View on GitHub

Showing 144 of 144 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public static final MediaFormat createAudioFormat(
            String mime,
            int sampleRate,
            int channelCount) {
        MediaFormat format = new MediaFormat();
Severity: Minor
Found in vitamio/src/io/vov/vitamio/MediaFormat.java and 1 other location - About 40 mins to fix
vitamio/src/io/vov/vitamio/MediaFormat.java on lines 413..423

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public static final MediaFormat createVideoFormat(
            String mime,
            int width,
            int height) {
        MediaFormat format = new MediaFormat();
Severity: Minor
Found in vitamio/src/io/vov/vitamio/MediaFormat.java and 1 other location - About 40 mins to fix
vitamio/src/io/vov/vitamio/MediaFormat.java on lines 377..387

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

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

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

            private static Bitmap transform(Matrix scaler, Bitmap source, int targetWidth, int targetHeight, int options) {
          Severity: Minor
          Found in vitamio/src/io/vov/vitamio/ThumbnailUtils.java - About 35 mins to fix

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

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

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

                private static void postEventFromNative(Object mediaplayer_ref, int what, int arg1, int arg2, Object obj) {
              Severity: Minor
              Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 35 mins to fix

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

                  private void audioTrackWrite(byte[] audioData, int offsetInBytes, int sizeInBytes) {
                    if (mAudioTrack != null && mAudioTrack.getPlayState() == AudioTrack.PLAYSTATE_PLAYING) {
                      int written;
                      while (sizeInBytes > 0) {
                        written = sizeInBytes > mAudioTrackBufferSize ? mAudioTrackBufferSize : sizeInBytes;
                Severity: Minor
                Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 35 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 onInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void onInfo(Message msg) {
                        switch (msg.arg1) {
                            case MediaPlayer.MEDIA_INFO_BUFFERING_START:
                                {
                                    //Log.i("MiuiVideo: receive buffer start, isplaying " + isPlaying());
                Severity: Minor
                Found in vitamio/src/io/vov/vitamio/MediaPlayer.java - About 35 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 parseSubstring has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private int parseSubstring(String s, int start, int defaultValue) {
                      int length = s.length();
                      if (start == length)
                        return defaultValue;
                
                
                Severity: Minor
                Found in vitamio/src/io/vov/vitamio/MediaScanner.java - About 35 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 createVideoThumbnail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  public static Bitmap createVideoThumbnail(Context ctx, String filePath, int kind) {
                    if (!Vitamio.isInitialized(ctx)) {
                      return null;
                    }
                    Bitmap bitmap = null;
                Severity: Minor
                Found in vitamio/src/io/vov/vitamio/ThumbnailUtils.java - About 35 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 postscan has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  private void postscan(String[] directories) throws RemoteException {
                    Iterator<FileCacheEntry> iterator = mFileCache.values().iterator();
                
                    while (iterator.hasNext()) {
                      FileCacheEntry entry = iterator.next();
                Severity: Minor
                Found in vitamio/src/io/vov/vitamio/MediaScanner.java - About 35 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

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                            case R.id.nav_zbigz:
                                fragment = ZbigzFragment.newInstance();
                                switchFragment(fragment);
                                mTitle = getString(R.string.nav_zbigz);
                                restoreActionBar();
                Severity: Minor
                Found in app/src/main/java/com/yashketkar/ykplayer/MainActivity.java and 2 other locations - About 35 mins to fix
                app/src/main/java/com/yashketkar/ykplayer/MainActivity.java on lines 194..199
                app/src/main/java/com/yashketkar/ykplayer/MainActivity.java on lines 206..211

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 44.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                if (val != null && (val.contains("(v7l)") || val.contains("ARMv7"))) {
                                    hasARMv6 = true;
                                    hasARMv7 = true;
                                }
                Severity: Minor
                Found in vitamio/src/io/vov/vitamio/utils/CPU.java and 1 other location - About 35 mins to fix
                vitamio/src/io/vov/vitamio/utils/CPU.java on lines 108..111

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 44.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    @Override
                    public void onAttach(Context context) {
                        super.onAttach(context);
                        if (context instanceof OnFragmentInteractionListener) {
                            mListener = (OnFragmentInteractionListener) context;
                Severity: Minor
                Found in app/src/main/java/com/yashketkar/ykplayer/LiveTVFragment.java and 2 other locations - About 35 mins to fix
                app/src/main/java/com/yashketkar/ykplayer/VideosFragment.java on lines 80..89
                app/src/main/java/com/yashketkar/ykplayer/ZbigzFragment.java on lines 99..108

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 44.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    @Override
                    public void onAttach(Context context) {
                        super.onAttach(context);
                        if (context instanceof OnFragmentInteractionListener) {
                            mListener = (OnFragmentInteractionListener) context;
                Severity: Minor
                Found in app/src/main/java/com/yashketkar/ykplayer/VideosFragment.java and 2 other locations - About 35 mins to fix
                app/src/main/java/com/yashketkar/ykplayer/LiveTVFragment.java on lines 175..184
                app/src/main/java/com/yashketkar/ykplayer/ZbigzFragment.java on lines 99..108

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 44.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    @Override
                    public void onAttach(Context context) {
                        super.onAttach(context);
                        if (context instanceof OnFragmentInteractionListener) {
                            mListener = (OnFragmentInteractionListener) context;
                Severity: Minor
                Found in app/src/main/java/com/yashketkar/ykplayer/ZbigzFragment.java and 2 other locations - About 35 mins to fix
                app/src/main/java/com/yashketkar/ykplayer/LiveTVFragment.java on lines 175..184
                app/src/main/java/com/yashketkar/ykplayer/VideosFragment.java on lines 80..89

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 44.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                            case R.id.nav_videos:
                                fragment = VideosFragment.newInstance();
                                switchFragment(fragment);
                                mTitle = getString(R.string.nav_local_videos);
                                restoreActionBar();
                Severity: Minor
                Found in app/src/main/java/com/yashketkar/ykplayer/MainActivity.java and 2 other locations - About 35 mins to fix
                app/src/main/java/com/yashketkar/ykplayer/MainActivity.java on lines 200..205
                app/src/main/java/com/yashketkar/ykplayer/MainActivity.java on lines 206..211

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 44.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language