mediawiki-skins-MinervaNeue/resources/skins.minerva.scripts
Timo Tijhof c1fe42fede Hygiene: Use early returns in a few places for special cases
When handling special cases that are logically distinct from
the function's main branch, it improves code quality (through
readability and maintainability) to place those first and with
an early return.

The has the benefit of the main return statement being easy to
find at the end of the function. (Not early and/or in a block).

It also means when working on the code, there is generally a
less complexity and fewer nesting levels, given that most code
is in the main branch. This makes is easier and quicker to verify
that code does what it should, as well as making it easy to
extend in the future. When considering to add code to end of a
function's main scope, it should relate to the function's main
branch by default, not a special case. For example, a getName()
method should not end with a top-level statement 'return false'
(unless it is a stub). Rather, one would expect it to end with
`return name`.

Change-Id: I1f3088f2409c82dd3bf757fc8fa27dc97ae2767b
2018-09-04 21:08:00 +00:00
..
AB.js Hygiene: move page issues A/B test logging to file 2018-08-14 20:49:06 +00:00
DownloadIcon.js Fix common typos in code 2018-08-27 20:54:16 +00:00
errorLogging.js Client side error reporting for Minerva+MobileFrontend 2018-08-30 14:35:27 -07:00
init.js Hygiene: Use early returns in a few places for special cases 2018-09-04 21:08:00 +00:00
initLogging.js Hygiene: Cleanup initialisation files 2017-09-07 17:48:58 +00:00
mobileRedirect.js Minerva is its own skin 2017-07-12 08:12:40 -07:00
pageIssues.js Hygiene: Use early returns in a few places for special cases 2018-09-04 21:08:00 +00:00
pageIssuesLogger.js Log sectionNumbers in PageIssues schema 2018-08-27 18:02:51 +00:00
PageIssuesOverlay.js Don't send NaN as a value for sectionNumbers 2018-08-28 18:26:09 +00:00
PageIssuesOverlay.less Hygiene: IssuesOverlay moved from MobileFrontend to Minerva 2018-08-16 14:06:12 -07:00
PageIssuesOverlayContent.hogan Hygiene: IssuesOverlay moved from MobileFrontend to Minerva 2018-08-16 14:06:12 -07:00
pageIssuesParser.js Hygiene: IssuesOverlay moved from MobileFrontend to Minerva 2018-08-16 14:06:12 -07:00
preInit.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00
references.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00
search.js Use OverlayManager for SearchOverlay 2018-04-05 15:23:36 +02:00
styles.less Remove unnecessary skins.minerva.base.styles 2018-07-26 01:18:00 +00:00