Showing 226 of 360 total issues
Method main
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void main(String[] s) {
String[] args = {"localhost", "10000"};
String serverName = args[0];
int port = Integer.parseInt(args[1]);
Method expCalculate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static BigDecimal expCalculate(Expression expression) {
List<ExpressionWord> postfix = getPostfix(expression); //获取表达式的后缀表达式
Stack<BigDecimal> result = new Stack<>(); //操作数栈
if (postfix != null && postfix.size() > 0) {
for (int i = 0; i < postfix.size(); i++) {
Method in
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
T in(Class<T> target, InputStream inputStream) {
T object = null;
try {
Reader reader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(reader);
Method getPostfix
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static List<ExpressionWord> getPostfix(Expression expression) {
List<ExpressionWord> midfix = expression.getWord(); //获取中缀表达式的经过词法分析器分析的结果集
List<ExpressionWord> result = new ArrayList<>(); //存储后缀表达式结果的List集合
Stack<ExpressionWord> operationStack = new Stack<>(); //操作符栈
Method doScanPackageClassesByFile
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void doScanPackageClassesByFile(
Set<Class<?>> classes,
String packageName,
String packagePath,
final boolean recursive) {
Method check
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static boolean check(Color chess[][], int x, int y, Color color) {
int count = 0;
int tempX = x;
int tempY = y;
for (; contains(chess, x - 1, y, color); x--)
- 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 loopEventSpin
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static void loopEventSpin(String type, BlockingQueue<AbstractLoopEvent> queue) {
while (true) {
try {
final AbstractLoopEvent event = queue.take();
final long delay = event.getDelay(TimeUnit.MILLISECONDS);
- 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 add
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
MythBaseStack<Integer> add(String one, String other) {
boolean oneResult = initBigInteger(one, oneStack);
boolean otherResult = initBigInteger(other, otherStack);
if (!oneResult || !otherResult) {
return 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 finallyResult
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void finallyResult() throws Exception {
Integer RightMin = maxList(Os, false, true, false);
boolean SUCCESS = true;
if (RightMin == -1) {
System.out.println("右列没有一个正数,最后一行也没有正数,原方程没有最优解");
- 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 calculateResult
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void calculateResult(List<String> expression) {
for (String row : expression) {
if (row.length() >= num) {
int temp = 0;
StringBuilder buffer = new StringBuilder();
- 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 doScanPackageClassesByFile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void doScanPackageClassesByFile(
Set<Class<?>> classes,
String packageName,
String packagePath,
final boolean recursive) {
- 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 match
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void match(String origin) {
log.info("input string={}", origin);
initBrackets();
MythBaseStack<Integer> stack = new MythLinkedStack<>();
Method main
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void main(String[] args) throws InterruptedException {
log.info("start");
Thread sleep = new Thread(() -> {
while (true) {
try {
Method transferOneKey
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void transferOneKey(String key, JedisPool originPool, JedisPool targetPool) {
try (Jedis originJedis = originPool.getResource()) {
originJedis.select(originDatabase);
String type = originJedis.type(key);
Optional<RedisDataType> dataType = RedisDataType.of(type);
Method actionPerformed
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void actionPerformed(ActionEvent event) {
if (PlayStageMgr.stageNoneStart()) {
return;
}
Method drawSelf
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void drawSelf(Graphics g) {
//系统画图函数的参照点 (全是取的左上角)
int topX, topY;
switch (direct) {
Method transferAllKey
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
void transferAllKey() throws InterruptedException {
boolean init = initRedisPool();
if (!init) {
return;
}
Method start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void start() {
master.execute(() -> {
while (!stop) {
long currentMills = System.currentTimeMillis();
try {
Method execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public List<R> execute(List<P> params, Function<P, R> handler) {
List<R> results = Collections.synchronizedList(new ArrayList<>());
for (P p : params) {
Method checkBong
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void checkBong(Tank tank, Bullet bullet) {
if (!bullet.alive || !tank.isAlive()) {
return;
}