Showing 226 of 360 total issues
Avoid too many return
statements within this method. Open
return 10000;
Avoid too many return
statements within this method. Open
return 0xf4240;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return 100;
Avoid too many return
statements within this method. Open
return count != 2 || color != myColor || block != 1 ? 0 : 1;
Avoid too many return
statements within this method. Open
return insertWheel(ChronoUnit.SECONDS, this.currentSecond.get() + 1, node);
Avoid too many return
statements within this method. Open
return 0x186a0;
Method willInfected
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void willInfected() {
if (this.isInfected()) {
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
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void run() {
File soundFile = new File(filename);
AudioInputStream audioInputStream;
try {
- 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 sort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public int[] sort(int[] data) {
int[] result = Arrays.copyOf(data, data.length);
for (int i = 1; i < result.length; i++) {
//用来冒泡的语句,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 sort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public int[] sort(int[] data) {
int[] result = Arrays.copyOf(data, data.length);
for (int i = 0; i < result.length - 1; 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 initBigInteger
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private boolean initBigInteger(String target, MythBaseStack<Integer> stack) {
String regex = "^[0-9]+$";
boolean oneResult = Pattern.matches(regex, target);
if (!oneResult) {
log.error("there are not integer: one={}", target);
- 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 transferAllKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
void transferAllKey() throws InterruptedException {
boolean init = initRedisPool();
if (!init) {
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
Method mouseClicked
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void mouseClicked(MouseEvent e) {
if (playerPlay) {
int x = getGridXY(e.getX());
int y = getGridXY(e.getY());
if (hasChess(x, y))
- 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 setSeed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final synchronized void setSeed(long seed) {
if (compact) {
setSeed((int) seed);
} else {
// Annoying runtime check for initialisation of internal data
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void run() {
int maxFPS = 60;
long fpsTime = (long) ((1000.0 / maxFPS) * 1_000_000);
- 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 filterClassName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private boolean filterClassName(String className) {
if (!className.endsWith(suffix)) {
return false;
}
- 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 getPackageAllClasses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public Set<Class<?>> getPackageAllClasses(String basePackage, boolean recursive) {
Set<Class<?>> classes = new LinkedHashSet<>();
String packageName = basePackage;
if (basePackage.endsWith(".")) {
packageName = basePackage.substring(0, basePackage.length() - 1);
- 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 readAndSend
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void readAndSend() {
try {
String line;
while ((line = keyIn.readLine()) != 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 isNeedContinue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private boolean isNeedContinue(List<Fraction> list) {
boolean flag = false;
for (Fraction b : list) {
if (b.isPositive()) {
flag = 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"