(self, params)
| 48 | return True |
| 49 | |
| 50 | def analyze(self, params): |
| 51 | |
| 52 | source_dir = params["source_dir"] |
| 53 | enabled_rules = params["rules"] |
| 54 | error_output = os.path.join(os.path.curdir, "spotbugs_result.xml") |
| 55 | |
| 56 | # analyze step |
| 57 | tool_name = "spotbugs" |
| 58 | visitors = RulesToVisitors(tool_name).get_needed_visitors(enabled_rules) |
| 59 | scan_cmd = [ |
| 60 | "java", |
| 61 | "-jar", |
| 62 | os.path.join(os.environ["SPOTBUGS_HOME"], "lib", "spotbugs.jar"), |
| 63 | "-textui", |
| 64 | "-low", |
| 65 | "-exitcode", |
| 66 | "-nested:false", |
| 67 | "-xml:withMessages", |
| 68 | ] |
| 69 | if visitors: |
| 70 | scan_cmd.append("-visitors") |
| 71 | scan_cmd.append(",".join(visitors)) |
| 72 | scan_cmd.extend(["-output", error_output, source_dir]) |
| 73 | self.print_log(" ".join(scan_cmd)) |
| 74 | SubProcController(scan_cmd).wait() |
| 75 | |
| 76 | # format step |
| 77 | ctf = ClassToFilename(source_dir) |
| 78 | items = Findbugs.data_handle(error_output, enabled_rules, ctf) |
| 79 | return items |
| 80 | |
| 81 | |
| 82 | tool = Spotbugs |
nothing calls this directly
no test coverage detected