Opened 3 years ago

Closed 2 years ago

#19731 closed enhancement (worksforme)

Apply more static code analysis to Java projects

Reported by: iwakeh Owned by: iwakeh
Priority: Medium Milestone:
Component: Metrics Version:
Severity: Normal Keywords: java, code, quality, metrics-2017
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

All Metrics' java projects now use checkstyle. This is great for ensuring coding standards.

For better code quality and bug prevention more static code analysis should be used.

First that come to mind here are:

This ticket should serve for discussion of these and possibly other tools.

Child Tickets

Change History (8)

comment:1 Changed 3 years ago by karsten

I tried out FindBugs in the past on an unrelated project and liked it, but I didn't try out PMD yet. Happy to give both a try, maybe on a single code base. We could decide based on the findings whether they're worth the effort for all code bases.

comment:2 Changed 3 years ago by iwakeh

I'd vote for having both:

  • pmd will remind about long classes with lot's of code and cumbersome if-expressions, duplicate code blocks and the like
  • findbugs really points out bugs, for example it points to some possible synchronization problems in Onionoo and also pointed at the possible NPE in CollecTor that I patched in #19018

comment:3 Changed 3 years ago by iwakeh

Owner: set to iwakeh
Status: newassigned

Owner wasn't set.

comment:4 Changed 3 years ago by iwakeh

We decided to apply both findbugs and pmd to all java code.

The 'pilot' ticket will use findbugs and pmd to the bridedescs module of Collector. cf. #19755

Closing.

comment:5 in reply to:  4 Changed 2 years ago by karsten

Summary: apply more static code analysis to java projectsApply more static code analysis to Java projects

Replying to iwakeh:

We decided to apply both findbugs and pmd to all java code.

The 'pilot' ticket will use findbugs and pmd to the bridedescs module of Collector. cf. #19755

Closing.

As in, closing this ticket? It's still open. :)

Capitalizing summary just in case it stays open.

comment:6 Changed 2 years ago by karsten

Keywords: metrics-2018 added

comment:7 Changed 2 years ago by karsten

Keywords: metrics-2017 added; metrics-2018 removed

comment:8 Changed 2 years ago by iwakeh

Resolution: worksforme
Status: assignedclosed

Closing for good (cf. comment:4 and comment:5).

Note: See TracTickets for help on using tickets.