Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

An exception is thrown when no results are generated due to a division by zero in JavaParserMain.scala at line 60

未关闭
#1 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
50/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
scala
领域
cli

调研方向

Start in javaparser/src/main/scala/com/virtuslab/semanticgraphs/javaparser/JavaParserMain.scala at line 60, where the failure percentage is calculated, and trace how generateSemanticGraphFiles is called from ScgCli.scala. Handle the zero-results case with a clear message instead of an ArithmeticException, and verify that normal result generation still reports its percentage.

由索引模型根据 Issue 内容生成。

描述

In this file, there is an instruction that shows the percentage of failed results compared to the total number of results generated. However, the total can be zero. It would be really helpful to have a message that says that no results have been generated, as it can be quite confusing to encounter a "dividing by zero" exception (see below) when using the tool for the first time.

java.lang.ArithmeticException: / by zero
	at com.virtuslab.semanticgraphs.javaparser.JavaParserMain$.generateSemanticGraphFiles(JavaParserMain.scala:60)
	at org.virtuslab.semanticgraphs.analytics.cli.ScgCli.generate(ScgCli.scala:59)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at picocli.CommandLine.executeUserObject(CommandLine.java:2066)
	at picocli.CommandLine.access$1500(CommandLine.java:148)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
	at picocli.CommandLine.execute(CommandLine.java:2170)
	at org.virtuslab.semanticgraphs.analytics.cli.ScgCli$.main(ScgCli.scala:335)
	at org.virtuslab.semanticgraphs.analytics.cli.ScgCli.main(ScgCli.scala)

主要语言
Scala
星标
26
派生
2
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。