alibaba / alibaba/open-code-review

OCR扫描pom后结论中显示Java代码,扫描文件和分析对不上

Open
#746 15 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
24.4k
Forks
1.8k
Avg merge
2d 6h
Merged PRs (30d)
105

Description

### OpenCodeReview Version

open-code-review v1.8.8 (6dc3eb0)

### Operating System

Linux (x86_64)

### Installation Method

npm (global)

### LLM Provider

Other OpenAI-compatible endpoint

### Bug Description

{
"path": "pom.xml",
"content": "`toString()` 方法不应使用 `System.out.println()` 进行输出,而应仅通过 `return` 返回对象的字符串表示。当前实现会导致每次调用 `toString()` 时产生大量标准输出,且调用方(如日志框架、调试器等)无法获取到任何有意义的返回值(虽然 return 也有字符串,但大量 println 会造成副作用和性能问题)。应移除所有 `System.out.println` 调用,只保留 `return` 语句。",
"existing_code": " public String toString() {\n System.out.println(\"id=\" + id );\n System.out.println(\"resourceId=\" + resourceId);\n System.out.println(\"name=\" + name);\n System.out.println(\"alias=\" + alias);",
"start_line": 0,
"end_line": 0,
"category": "bug",
"severity": "high"
},

### Steps to Reproduce

ocr review \
--from "origin/test" \
--to "origin/dev" \
--format json \
--concurrency 4 \
--audience agent --format json > ocr-result.json

### Expected Behavior

ocr扫描报告能准确匹配

### Logs / Error Output

```shell

```

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the shown `ocr review` command using the `origin/test` and `origin/dev` revisions, then inspect `ocr-result.json`. Compare the reported `path`, `content`, `existing_code`, and line fields for `pom.xml` with the scanned source. Done means the report identifies the actual scanned file and matching Java code.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, java
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.