Problem/Motivation

PHPCS runs out of memory on PHP5.5 and is slow cause of huge files - drupal6.php and drupal7.php - these are generated files and not runtime so coding standards checks are pointless. Let's ignore them.

Proposed resolution

Ignore them.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

With the patch

 8.1.x  alex: ~/dev/sites/drupal8alt.dev/core > phpcs -p
............................................................   60 / 6283 (1%)
............................................................  120 / 6283 (2%)
............................................................  180 / 6283 (3%)
............................................................  240 / 6283 (4%)
............................................................  300 / 6283 (5%)
............................................................  360 / 6283 (6%)
............................................................  420 / 6283 (7%)
...........S................................................  480 / 6283 (8%)
............................................................  540 / 6283 (9%)
............................................................  600 / 6283 (10%)
............................................................  660 / 6283 (11%)
............................................................  720 / 6283 (11%)
............................................................  780 / 6283 (12%)
............................................................  840 / 6283 (13%)
............................................................  900 / 6283 (14%)
............................................................  960 / 6283 (15%)
............................................................ 1020 / 6283 (16%)
............................................................ 1080 / 6283 (17%)
............................................................ 1140 / 6283 (18%)
............................................................ 1200 / 6283 (19%)
............................................................ 1260 / 6283 (20%)
............................................................ 1320 / 6283 (21%)
............................................................ 1380 / 6283 (22%)
............................................................ 1440 / 6283 (23%)
............................................................ 1500 / 6283 (24%)
............................................................ 1560 / 6283 (25%)
............................................................ 1620 / 6283 (26%)
............................................................ 1680 / 6283 (27%)
............................................................ 1740 / 6283 (28%)
............................................................ 1800 / 6283 (29%)
............................................................ 1860 / 6283 (30%)
............................................................ 1920 / 6283 (31%)
............................................................ 1980 / 6283 (32%)
............................................................ 2040 / 6283 (32%)
............................................................ 2100 / 6283 (33%)
............................................................ 2160 / 6283 (34%)
............................................................ 2220 / 6283 (35%)
............................................................ 2280 / 6283 (36%)
............................................................ 2340 / 6283 (37%)
............................................................ 2400 / 6283 (38%)
............................................................ 2460 / 6283 (39%)
............................................................ 2520 / 6283 (40%)
............................................................ 2580 / 6283 (41%)
............................................................ 2640 / 6283 (42%)
............................................................ 2700 / 6283 (43%)
............................................................ 2760 / 6283 (44%)
............................................................ 2820 / 6283 (45%)
............................................................ 2880 / 6283 (46%)
............................................................ 2940 / 6283 (47%)
............................................................ 3000 / 6283 (48%)
............................................................ 3060 / 6283 (49%)
............................................................ 3120 / 6283 (50%)
............................................................ 3180 / 6283 (51%)
............................................................ 3240 / 6283 (52%)
............................................................ 3300 / 6283 (53%)
............................................................ 3360 / 6283 (53%)
............................................................ 3420 / 6283 (54%)
.................SS......................................... 3480 / 6283 (55%)
............................................................ 3540 / 6283 (56%)
............................................................ 3600 / 6283 (57%)
............................................................ 3660 / 6283 (58%)
............................................................ 3720 / 6283 (59%)
............................................................ 3780 / 6283 (60%)
............................................................ 3840 / 6283 (61%)
............................................................ 3900 / 6283 (62%)
............................................................ 3960 / 6283 (63%)
..........................S................................. 4020 / 6283 (64%)
............................................................ 4080 / 6283 (65%)
............................................................ 4140 / 6283 (66%)
............................................................ 4200 / 6283 (67%)
............................................................ 4260 / 6283 (68%)
............................................................ 4320 / 6283 (69%)
............................................................ 4380 / 6283 (70%)
............................................................ 4440 / 6283 (71%)
............................................................ 4500 / 6283 (72%)
............................................................ 4560 / 6283 (73%)
.......................S.................................... 4620 / 6283 (74%)
............................................................ 4680 / 6283 (74%)
............................................................ 4740 / 6283 (75%)
............................................................ 4800 / 6283 (76%)
............................................................ 4860 / 6283 (77%)
............................................................ 4920 / 6283 (78%)
............................................................ 4980 / 6283 (79%)
............................................................ 5040 / 6283 (80%)
............................................................ 5100 / 6283 (81%)
............................................................ 5160 / 6283 (82%)
............................................................ 5220 / 6283 (83%)
............................................................ 5280 / 6283 (84%)
............................................................ 5340 / 6283 (85%)
............................................................ 5400 / 6283 (86%)
............................................................ 5460 / 6283 (87%)
............................................................ 5520 / 6283 (88%)
............................................................ 5580 / 6283 (89%)
............................................................ 5640 / 6283 (90%)
............................................................ 5700 / 6283 (91%)
............................................................ 5760 / 6283 (92%)
............................................................ 5820 / 6283 (93%)
............................................................ 5880 / 6283 (94%)
............................................................ 5940 / 6283 (95%)
............................................................ 6000 / 6283 (95%)
............................................................ 6060 / 6283 (96%)
............................................................ 6120 / 6283 (97%)
............................................................ 6180 / 6283 (98%)
............................................................ 6240 / 6283 (99%)
...........................................

Time: 2 mins, 21.48 secs; Memory: 125.25Mb

 8.1.x  alex: ~/dev/sites/drupal8alt.dev/core > php -v
PHP 5.5.18 (cli) (built: Nov  3 2014 09:22:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

Without the patch

 8.1.x  alex: ~/dev/sites/drupal8alt.dev/core > phpcs -p
............................................................   60 / 6283 (1%)
............................................................  120 / 6283 (2%)
............................................................  180 / 6283 (3%)
............................................................  240 / 6283 (4%)
............................................................  300 / 6283 (5%)
............................................................  360 / 6283 (6%)
............................................................  420 / 6283 (7%)
...........S................................................  480 / 6283 (8%)
............................................................  540 / 6283 (9%)
............................................................  600 / 6283 (10%)
............................................................  660 / 6283 (11%)
............................................................  720 / 6283 (11%)
............................................................  780 / 6283 (12%)
............................................................  840 / 6283 (13%)
............................................................  900 / 6283 (14%)
............................................................  960 / 6283 (15%)
............................................................ 1020 / 6283 (16%)
............................................................ 1080 / 6283 (17%)
............................................................ 1140 / 6283 (18%)
............................................................ 1200 / 6283 (19%)
............................................................ 1260 / 6283 (20%)
............................................................ 1320 / 6283 (21%)
............................................................ 1380 / 6283 (22%)
............................................................ 1440 / 6283 (23%)
............................................................ 1500 / 6283 (24%)
............................................................ 1560 / 6283 (25%)
............................................................ 1620 / 6283 (26%)
............................................................ 1680 / 6283 (27%)
............................................................ 1740 / 6283 (28%)
............................................................ 1800 / 6283 (29%)
............................................................ 1860 / 6283 (30%)
............................................................ 1920 / 6283 (31%)
............................................................ 1980 / 6283 (32%)
............................................................ 2040 / 6283 (32%)
............................................................ 2100 / 6283 (33%)
............................................................ 2160 / 6283 (34%)
............................................................ 2220 / 6283 (35%)
............................................................ 2280 / 6283 (36%)
............................................................ 2340 / 6283 (37%)
............................................................ 2400 / 6283 (38%)
............................................................ 2460 / 6283 (39%)
............................................................ 2520 / 6283 (40%)
............................................................ 2580 / 6283 (41%)
............................................................ 2640 / 6283 (42%)
............................................................ 2700 / 6283 (43%)
............................................................ 2760 / 6283 (44%)
............................................................ 2820 / 6283 (45%)
............................................................ 2880 / 6283 (46%)
............................................................ 2940 / 6283 (47%)
............................................................ 3000 / 6283 (48%)
............................................................ 3060 / 6283 (49%)
............................................................ 3120 / 6283 (50%)
............................................................ 3180 / 6283 (51%)
............................................................ 3240 / 6283 (52%)
............................................................ 3300 / 6283 (53%)
............................................................ 3360 / 6283 (53%)
............................................................ 3420 / 6283 (54%)
..................PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /Users/alex/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Fixer.php on line 139

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /Users/alex/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Fixer.php on line 139
alexpott’s picture

So the DbDumpCommand should add this comment then...

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Looks perfect for me. For a second I was wondering whether we should add it also to the generated proxy files and/or the DB updates fixture files, but both are reasonable small.

xjm’s picture

Title: PHPCS runs out of memory on PHP5.5 and is slow cause of huge files » Coding standards check on DB dump fixtures causes PHPCS to out of memory on PHP5.5 and is slow cause of huge files

This patch resolved the issue for me as well.

  • xjm committed 2d59601 on 8.1.x
    Issue #2676346 by alexpott, dawehner: Coding standards check on DB dump...

  • xjm committed c254ef6 on 8.0.x
    Issue #2676346 by alexpott, dawehner: Coding standards check on DB dump...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.1.x and cherry-picked to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.