Showing 231 of 426 total issues
File IntentHelper.java
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.bedrock.padder.helper;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
Method setPresetInfo
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void setPresetInfo() {
toolbar.setActionBar(a, v);
toolbar.setActionBarTitle(R.string.about);
toolbar.setActionBarPadding(a, v);
toolbar.setActionBarDisplayHomeAsUpIcon(R.drawable.ic_close_white);
File PresetStoreActivity.java
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.bedrock.padder.activity;
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
Method setAdapter
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setAdapter() {
if (isPresetDownloading) {
// attach adapter while its not null
presetStoreAdapter = new PresetStoreAdapter(
online,
Method initListener
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initListener() {
normal.setSoundListener(new Sound.SoundListener() {
@Override
public void onSoundStart(Sound sound, int playingThreadCount) {
threadCount++;
SettingsActivity
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
public class SettingsActivity extends AppCompatActivity {
private WindowHelper w = new WindowHelper();
private AnimateHelper anim = new AnimateHelper();
private IntentHelper intent = new IntentHelper();
IntentHelper
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
public class IntentHelper {
public void intent(final Activity activity, String name, int delay) {
final String classname = "com.bedrock.padder." + name;
File SettingsActivity.java
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.bedrock.padder.activity;
import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
Method initUi
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initUi() {
switch (MODE_TAG) {
case "song":
// layout
RelativeLayout songLayout = findViewById(R.id.feedback_song);
ItemAdapter
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.DetailViewHolder> {
private Item[] item;
private int rowLayout;
private Context context;
private Activity activity;
Method doInBackground
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected Integer doInBackground(Void... voids) {
// new http file download
input = 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 showTutorial
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private void showTutorial() {
final ImageView tutorialToolbar = findViewById(R.id.toolbar_tutorial_icon);
if (isTutorialVisible == false) {
isTutorialVisible = true;
- 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 doInBackground
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected Void doInBackground(Void... params) {
if (previousPreset != null) {
Log.i(TAG, "Preset \"" + currentPreset.getTag() + "\" loading");
for (int i = 0; i < 4; i++) {
- 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 onCreate
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Method onBindViewHolder
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onBindViewHolder(final DetailViewHolder holder, int position) {
holder.itemText.setText(item[position].getText(context));
if (item[position].getHint(context) == null || item[position].getHint(context).equals("")) {
- 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 validateEditText
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean validateEditText(EditText editText) {
Log.d(TAG, "validateEditText");
switch (MODE_TAG) {
case "song":
if (editText == songName) {
Method setToolbar
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setToolbar() {
// set bottom margin
w.setMarginRelativePX(R.id.toolbar, 0, 0, 0, w.getNavigationBarFromPrefs(a), a);
View info = findViewById(R.id.toolbar_info);
PresetStoreActivity
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
public class PresetStoreActivity extends AppCompatActivity implements FileChooserDialog.FileCallback {
private WindowHelper window = new WindowHelper();
private AnimateHelper anim = new AnimateHelper();
private ToolbarHelper toolbar = new ToolbarHelper();
Method buttonRevealAnimation
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void buttonRevealAnimation(final int buttonRectIndex) {
final Rect buttonRects[] = {
window.getRect(R.id.btn00, activity),
window.getRect(R.id.tgl1, activity),
window.getRect(R.id.tgl2, activity),
Method doInBackground
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected Integer doInBackground(Void... voids) {
// new http file download
input = null;