[Geoserver-devel] [JIRA] (GEOS-10109) Excessive (500+) method lengths. Add a PMD rule to enforce it.

Gabriel Roldan created an issue

GeoServer / ImprovementGEOS-10109

Excessive (500+) method lengths. Add a PMD rule to enforce it.

Issue Type:

ImprovementImprovement

Assignee:

Unassigned

Created:

12/Jun/21 3:20 PM

Priority:

MediumMedium

Reporter:

Gabriel Roldan

https://pmd.github.io/latest/pmd_rules_plsql_design.html#excessivemethodlength

This QA metric is primarily related to the difficulty to follow code paths on too large methods. Both for the original author and others.
Excessive method length speaks also of a bad internal design for a class.
Ideally, a method should do one single thing, at a given abstraction level, and defer lowe level implementation details to other, properly named methods, and so on, in a way that at a glance, a reader can figure out what a method does, and drill down to more and more implementation detail only if needed.

The PMD rule’s default threshold is 100 lines of code. We have way too many methods over that count to tackle it in a single shot.
Setting an initial value of 500 leaves us with the 4 biggest offenders. Please check this assessment for more information:

https://github.com/groldan/geoserver/wiki/ExcessiveMethodLength-PMD-assessment—GeoServer

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100166-sha1:25236ce)

Atlassian logo