Showing 108 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");
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;
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");
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;
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;
- Read upRead up
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;
- Read upRead up
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;
- Read upRead up
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) {
- Read upRead up
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;
- Read upRead up
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.
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");
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;
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");
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()) {
- Read upRead up
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;
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;
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()) {
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;
- Read upRead up
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;
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;