Showing 231 of 426 total issues
Method moveXYinDP
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
public void moveXYinDP(int view,
int fromX, int toX,
int durationX, int delayX, TimeInterpolator intX,
int fromY, int toY,
int durationY, int delayY, TimeInterpolator intY,
Method select
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private void select(int index) {
Log.d("SH", "Index selected " + index);
// index starts from 0
if (index == -1) {
// disable all
- 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 moveXYinPX
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
public void moveXYinPX(int view,
int fromX, int toX,
int durationX, int delayX, TimeInterpolator intX,
int fromY, int toY,
int durationY, int delayY, TimeInterpolator intY,
Method onCreate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
Method checkVersion
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void checkVersion() {
try {
currentVersionCode = a.getPackageManager().getPackageInfo(a.getPackageName(), 0).versionCode;
Log.i("versionCode", "versionCode retrieved = " + String.valueOf(currentVersionCode));
} catch (android.content.pm.PackageManager.NameNotFoundException e) {
Method onPreExecute
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onPreExecute() {
super.onPreExecute();
// started loading
isPresetLoading = true;
Method onPreExecute
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onPreExecute() {
if (isConnected(activity)) {
// create preset project folder
new File(PROJECT_LOCATION_PRESETS + "/" + tag).mkdirs();
Method moveXYinPX
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
public void moveXYinPX(View view,
int fromX, int toX,
int durationX, int delayX, TimeInterpolator intX,
int fromY, int toY,
int durationY, int delayY, TimeInterpolator intY,
Method send
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean send() {
if (validateAll() == true) {
switch (MODE_TAG) {
case "song":
sendMessage = "Song title = \"" + songNameString + "\"" + br +
Method fadeOut
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public void fadeOut(final int id, final int delay, final long duration, Activity activity) {
final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
final View view = activity.findViewById(id);
if (view.getVisibility() == View.VISIBLE) {
- 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 fadeOut
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public void fadeOut(final View view, final int delay, final long duration, Activity activity) {
final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
if (view.getVisibility() == View.VISIBLE) {
PowerManager powerManager = (PowerManager) activity.getSystemService(POWER_SERVICE);
- 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 getPadStringFromIndex
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String getPadStringFromIndex(int padIndex) {
switch (padIndex) {
case 0:
return "00";
case 1:
Method onCreate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setButtonBackVisible(false);
Method setIntents
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setIntents() {
// presets
(a.findViewById(R.id.layout_settings_preset)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Method onResume
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void onResume() {
super.onResume();
Log.d("MainActivity", "onResume");
Method play
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
void play() {
try {
Log.i(TAG, "Attempted to play " + soundPoolId);
if (isLooping && canLoop) {
canLoop = false;
Method fadeOutInvisible
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void fadeOutInvisible(final int id, final int delay, final long duration, View parentView, Activity activity) {
final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
final View view = parentView.findViewById(id);
PowerManager powerManager = (PowerManager) activity.getSystemService(POWER_SERVICE);
Method fadeOutInvisible
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void fadeOutInvisible(final int id, final int delay, final long duration, Activity activity) {
final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
final View view = activity.findViewById(id);
PowerManager powerManager = (PowerManager) activity.getSystemService(POWER_SERVICE);
Method init
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void init() {
handler = new Handler(Looper.getMainLooper());
for (int i = 0; i < decks.length; i++) {
decks[i] = activity.findViewById(getId("tgl" + String.valueOf(i + 1) + "_tutorial"));
Method doInBackground
has 35 lines of code (exceeds 25 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++) {