You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checks for functions which are only called in 1 location.
Enabling this lint can guard against segmentation which can occur stealthily over a long period of development, when a function is split purposefully for testing or readability this lint can be allowed for these specific cases.
Advantage
Functions that are only called once, may be better suited as scopes or in-lined.
Premature abstraction can occur in development leading to segmentation with many small functions that are only called once, this can introduce significant additional complexity and indirection that makes the code-base less readable.
Drawbacks
It can be useful to split a large function into sub-functions even when these are only called once each, this can improve test-ability and readability. This is often done purposefully.
Example
fnmain(){one();}fnone(){// [...]}
Could be written as:
fnmain(){// [...]}
The text was updated successfully, but these errors were encountered:
What it does
Checks for functions which are only called in 1 location.
Enabling this lint can guard against segmentation which can occur stealthily over a long period of development, when a function is split purposefully for testing or readability this lint can be allowed for these specific cases.
Advantage
Functions that are only called once, may be better suited as scopes or in-lined.
Premature abstraction can occur in development leading to segmentation with many small functions that are only called once, this can introduce significant additional complexity and indirection that makes the code-base less readable.
Drawbacks
It can be useful to split a large function into sub-functions even when these are only called once each, this can improve test-ability and readability. This is often done purposefully.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: