
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
45 lines
1.6 KiB
Plaintext
45 lines
1.6 KiB
Plaintext
== Why is this an issue?
|
|
|
|
A function or stored procedure that grows too large tends to aggregate too many responsibilities. Such function or stored procedure inevitably become harder to understand and therefore harder to maintain.
|
|
|
|
|
|
Above a specific threshold, it is strongly advised to refactor into smaller functions or stored procedures which focus on well-defined tasks. Those smaller functions or stored procedures will not only be easier to understand, but also probably easier to test.
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
=== Parameters
|
|
|
|
.max
|
|
****
|
|
|
|
----
|
|
100
|
|
----
|
|
|
|
Maximum authorized lines of code in a function or stored procedure
|
|
****
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 7 Mar 2018, 18:59:44 Ann Campbell wrote:
|
|
\[~christophe.zurn], you plan to implement this as "too many lines of code", rather than "too many lines" (including comments, blank lines, ...), right?
|
|
|
|
=== on 8 Mar 2018, 08:15:20 Christophe Zurn wrote:
|
|
\[~ann.campbell.2] Yes, that's the goal. I inspired myself from the other implementations, but after explanations I understood that we aim to go with LOC instead of of just lines
|
|
|
|
=== on 8 Mar 2018, 08:33:41 Christophe Zurn wrote:
|
|
\[~ann.campbell.2]In the same direction, should we change the message "This [function|method|module|subroutine] "XXXX" has {0} lines, which is greater than the {1} lines authorized. Split it into smaller [functions|methods|modules|subroutines]." to explicitly say "lines of code" instead of just "lines" ?
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|