Showing 217 of 353 total issues
Method channelRead0
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
Channel ch = ctx.channel();
if (!shaker.isHandshakeComplete()) {
try {
Method sortData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void sortData(int[] data, int low, int high) {
int lowIndex = low;
int highIndex = high;
int index = data[low];
Method paint
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void paint(Graphics graphics) {
super.paint(graphics);
//draw border
Method openFile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void openFile() {
//推荐JFileChooser 组件
JFileChooser jc = new JFileChooser();
//设置名字
jc.setDialogTitle("Please select file...");
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Result execute(Param param, long timeout, TimeUnit timeUnit) {
final LinkedBlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<>(1000);
final Result result = Result.builder().dataList(Collections.synchronizedList(new ArrayList<>()))
.build();
Method quickSort
has 28 lines of code (exceeds 25 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) {
Method insertWheel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean insertWheel(String id, Duration delay) {
long days = delay.toDays();
if (days > 30) {
log.warn("out of timeWheel max delay bound");
return false;
Method showRows
has 28 lines of code (exceeds 25 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(" + ");
Method decrypt
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
String decrypt(String text) throws AesException {
byte[] original;
try {
// 设置解密模式为AES的CBC模式
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
Method init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void init() {
try {
keyIn = new BufferedReader(new InputStreamReader(System.in));
socket = new Socket("127.0.0.1", ChatProtocol.SERVER_PORT);
ps = new PrintStream(socket.getOutputStream());
Method setSeed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public final synchronized void setSeed(int[] buf) {
int length = buf.length;
if (length == 0) {
throw new IllegalArgumentException("Seed buffer may not be empty");
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void sortData(int[] data, int low, int high) {
if (low >= high) {
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 removeAndAdd
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void removeAndAdd(ChronoUnit unit, int index) {
LinkedList<TaskNode>[] lists = wheels.get(unit);
LinkedList<TaskNode> list = lists[index];
if (Objects.nonNull(list) && !list.isEmpty()) {
List<TaskNode> nodes = list.toList();
- 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 actionPerformed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void actionPerformed(ActionEvent event) {
if (PlayStageMgr.stageNoneStart()) {
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 btnEqualActionPerformed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
void btnEqualActionPerformed() {
if (!calculateFlag) { //未曾按下等于运算符
behind = txtResult.getText();
} else {
front = result;
- 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 otherThreadWithOOM
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void otherThreadWithOOM() throws Exception {
// 如果将该集合定义在这里 就会被所有线程共享 被引用数会多, 不容易回收, 就容易引起全面的OOM 导致进程退出
// List<byte[]> data = new ArrayList<>();
Thread allocateMemory = new Thread(() -> {
- 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 shotEnemy
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void shotEnemy() {
final long nowMs = System.currentTimeMillis();
if (lastShotMs != 0 && nowMs - lastShotMs < shotCDMs) {
return;
}
Method setSeed
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public final synchronized void setSeed(int[] buf) {
int length = buf.length;
if (length == 0) {
throw new IllegalArgumentException("Seed buffer may not be empty");
Method main
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void main(String[] args) {
DisposableServer server = HttpServer.create()
.route(routes -> routes
.get("/hello",
(request, response) -> {
Method init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void init() {
//添加求解式的数据
String max = config.getString("Max");
String[] temp = max.split(",");
for (String data : temp) {