maoni/src/main/java/org/rm3l/maoni/Maoni.java
File Maoni.java
has 584 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright (c) 2016-2022 Armel Soro
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Builder
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public static class Builder {
@Nullable
private final Context context;
Method start
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
private void start(Activity callerActivity, Window window) {
if (mUsed.getAndSet(true)) {
this.clear();
throw new UnsupportedOperationException(
"Maoni instance cannot be reused to start a new activity. " +
- 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 start
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void start(Activity callerActivity, Window window) {
if (mUsed.getAndSet(true)) {
this.clear();
throw new UnsupportedOperationException(
"Maoni instance cannot be reused to start a new activity. " +
Method withSharedPreferences
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public Builder withSharedPreferences(@Nullable final Map<String, Integer> sharedPreferencesModeMap) {
if (sharedPreferencesModeMap == null || sharedPreferencesModeMap.isEmpty()) {
return this;
}
if (this.context == 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"