Showing 221 of 349 total issues
Method readAll
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void readAll() {
InputStream input = null;
BufferedReader br = null;
InputStreamReader ids = null;
try {
Expression
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
public class Expression {
private String expression; //算术表达式字符串
private final List<ExpressionWord> expressionWord; //存储表达式词法分析所得的单词与该单词所对应的种别编码的集合
private int index; //读取词法分析器的字符游标
File Calculator.java
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.github.kuangcp.caculator;
import java.awt.Dimension;
import java.awt.Font;
Method startNewRound
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public void startNewRound() {
enemyList = new CopyOnWriteArrayList<>();
bricks = new CopyOnWriteArrayList<>();
irons = new CopyOnWriteArrayList<>();
- 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 pushTimeWheel
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private void pushTimeWheel(int seconds) {
Map<ChronoUnit, Integer> tempIndex = new HashMap<>(sortedSlots.size());
for (int i = 0; i < sortedSlots.size(); i++) {
ChronoUnit unit = sortedSlots.get(i);
Integer threshold = slots.get(unit);
- 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 startNewRound
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void startNewRound() {
enemyList = new CopyOnWriteArrayList<>();
bricks = new CopyOnWriteArrayList<>();
irons = new CopyOnWriteArrayList<>();
File Saved.java
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.github.kuangcp.tank.util;
import com.github.kuangcp.tank.domain.Brick;
import com.github.kuangcp.tank.domain.EnemyTank;
import com.github.kuangcp.tank.domain.Hero;
Method findEffectiveArea
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private void findEffectiveArea() {
for (int i = 0; i <= 14; i++) {
for (int j = 0; j <= 14; j++)
if (chess[i][j] != null) {
effectiveX1 = 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 quickSort
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public <T extends Comparable<? super T>> T[] quickSort(T[] data, int start, int end) {
int low = start + 1, high = end;
T key = data[start];
if (start >= end) {
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
public void run() throws Exception {
init();
//运算出初始的表格
display("中间计算结果", Tables);
//计算最底下一行
- 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 findDiffIndexPoint
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static int findDiffIndexPoint(String a, String b) {
if (StringUtils.equals(a, b)) {
return 0;
}
if (Objects.isNull(a)) {
Method savedAll
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void savedAll() {
BufferedWriter bw = null;
OutputStream out = null;
OutputStreamWriter os = null;
Method saveDataBase
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void saveDataBase() {
PreparedStatement ps = null;
Connection cn = null;
ResultSet rs = null;
Method ablePass
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static boolean ablePass(Tank t, Hinder h) {
int hx = h.getWidth(), hy = h.getHeight();
final int halfHeight = t.getHalfHeight();
final int halfWidth = t.getHalfWidth();
Method findDiffIndex
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static int findDiffIndex(String a, String b) {
if (StringUtils.equals(a, b)) {
return 0;
}
if (Objects.isNull(a)) {
Method paintComponent
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected void paintComponent(Graphics g) {
int offset = 4;
int r = 5;
int chessR = 20;
- 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 sortData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void sortData(int[] data, int low, int high) {
int lowIndex = low;
int highIndex = high;
int index = data[low];
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public void start() throws IOException {
Selector selector = Selector.open();
//通过OPEN方法来打开一个未绑定的ServerSocketChannel 实例
ServerSocketChannel server = ServerSocketChannel.open();
//将该ServerSocketChannel绑定到指定ip
- 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 showRows
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private void showRows() {
StringBuilder MaxRows = new StringBuilder("Max(z)=");
for (int i = 0; i < MAX_PARAMS; i++) {
if (!Max.get(i).isZero()) {
MaxRows.append(Max.get(i)).append(" X").append(i + 1).append(" + ");
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void run() throws Exception {
init();
//运算出初始的表格
display("中间计算结果", Tables);
//计算最底下一行