Showing 231 of 426 total issues
Method circularRevealInPx
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void circularRevealInPx(int view,
int centerX, int centerY,
int startRad, int endRad, TimeInterpolator interpolator,
int duration, int delay, Activity activity) {
Method circularRevealAnimator
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Animator circularRevealAnimator(int view,
int centerX, int centerY,
int startRad, int endRad, TimeInterpolator interpolator,
int duration, int delay, Activity activity) {
Method setDecks
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void setDecks(int color, int colorDef, Activity activity) {
Preferences preferences = new Preferences(activity);
this.color = preferences.getColor();
this.colorDef = colorDef;
decks = new Deck[]{
Method run
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void run() {
// Current sync
Sync sync = syncs.get(currentSyncIndex++);
Method circularRevealinDP
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void circularRevealinDP(int view,
int centerX, int centerY,
int startRad, int endRad, TimeInterpolator interpolator,
int duration, int delay, Activity activity) {
Method onRequestPermissionsResult
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case REQUEST_WRITE_STORAGE:
Method cancel
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
void cancel() {
isPresetDownloading = false;
if (item != null) {
item.setBytesTransferred(-1);
item.setTotalByteCount(-1);
Method setPresetInfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setPresetInfo() {
if (isAboutVisible == false && currentPreset != null) {
themeColor = currentPreset.getAbout().getColor();
toolbar.setActionBarTitle(0);
toolbar.setActionBarColor(themeColor, a);
Method setPadColor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
void setPadColor(int row, int column, final int color, int duration, int delay) {
if (row * column != 0) {
final View pad = getViewFromId("btn" + column + row, activity);
if (getBackgroundColor(pad) != getColor(color, activity) && getBackgroundColor(pad) != getColor(color, activity)) {
// was not pressed
- 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 setNavigationBar
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void setNavigationBar(int colorId, Activity activity) {
if (Build.VERSION.SDK_INT >= 16) {
if (colorId == R.color.transparent) {
activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- 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 loadColor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void loadColor(int color) {
if (decks != null && currentPreset != null) {
for (Deck deck : decks) {
for (Pad pad : deck.getPads()) {
if (pad != null) {
- 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 onProgressUpdate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onProgressUpdate(Boolean... args) {
// update progress
if (mProgress > previousProgressCount) {
// less updates
Method setLoadingFailed
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setLoadingFailed(boolean isFailed) {
if (isFailed) {
Log.e(TAG, "Loading failed");
anim.fadeOut(recyclerView, 0, 200, a);
anim.fadeOut(recyclerViewLoading, 0, 200, a);
Method isPresetAvailable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean isPresetAvailable(Preset preset) {
// with sound count check
if (preset != null) {
String presetName = preset.getTag();
// preset available
Method onCreate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_preset_store);
Method setUi
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setUi() {
// toolbar
toolbar.setActionBar(this);
toolbar.setStatusBarTint(this);
toolbar.setActionBarPadding(this);
Method setActions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setActions() {
window.setOnClick(R.id.activity_help_contact_email, new Runnable() {
@Override
public void run() {
intent.intentEmail(activity, R.string.feedback_email,
Method onPostExecute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onPostExecute(Integer integer) {
Log.d(TAG, "onPostExecute");
super.onPostExecute(integer);
// finished unzipping, delete the original zip file
Method scaleIn
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void scaleIn(final int id, int touchX, int touchY, final int delay, final long duration, String handlerName, Activity activity) {
final View view = activity.findViewById(id);
float x = touchX / window.getWindowWidthPx(activity);
float y = touchY / window.getWindowHeightPx(activity);
final ScaleAnimation scaleOut = new ScaleAnimation(0, 1, 0, 1, Animation.ABSOLUTE, x, Animation.ABSOLUTE, y);
Method doInBackground
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected Integer doInBackground(Void... params) {
try {
FileInputStream fileInputStream = new FileInputStream(zipLocation);
ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);