PHPCS
1. Missing .gitignore file
2. Missing .cspell.json file
3. Missing .gitlab-ci.yml file
4. Missing .prettierrc.json file
5. composer.json missing authors and support sections
6. info.yml core_version_requirement was ^10 || ^11, should be ^10.3 || ^11
7. Missing @file docblocks in PHP files
8. Missing declare(strict_types=1) in PHP files
9. Missing return types on methods
10. Inline field array declarations in .install not expanded to multi-line
format
11. \Drupal::time() static call in CssAnalyzerService — inject TimeInterface
instead
12. \Drupal::service('database') static call in CssAnalyzerService — inject
Connection instead
13. \Drupal::service('css_usage_analyzer.analyzer') static call in
SettingsForm — inject via create() pattern
14. \Drupal::request() static calls in BulkScanForm — inject RequestStack
instead
15. \Drupal::request() and \Drupal::messenger() and \Drupal::httpClient()
static calls in CssUsageAnalyzerController — inject RequestStack and
ClientInterface
16. Line length warnings in CssAnalyzerService.php (lines exceeding 80 chars)
17. Line length warnings in README.md (7 lines exceeding 80 chars)
18. services.yml missing new constructor arguments for CssAnalyzerService
(@datetime.time, @database)
ESLint
19. 'use strict' inside IIFE in css-charts.js
20. 'use strict' inside IIFE in bulk-scanner.js
21. 'use strict' inside IIFE in critical-css.js
22. 'use strict' inside IIFE in css-analyzer.js
23. no-new — new Chart() called for side effects without storing result
(css-charts.js)
24. no-undef — Chart global not declared (css-charts.js) — add /* global Chart
*/
25. prefer-template — v + ' KB' string concatenation in css-charts.js
26. prefer-template — pct + '%' string concatenation in bulk-scanner.js
27. class-methods-use-this — addParam() method doesn't use this in
bulk-scanner.js — make static
28. no-unused-vars — label variable declared but never used in bulk-scanner.js
29. no-plusplus — this.current++ in bulk-scanner.js
30. prettier/prettier — addParam() call arguments not formatted across lines
in bulk-scanner.js
31. no-use-before-define — cuaFlashBtn and cuaFallbackCopy used before defined
in critical-css.js
32. max-nested-callbacks — 4 levels deep in critical-css.js — extract click
handlers to named functions
33. no-restricted-syntax — three for...of loops in css-analyzer.js — convert
to forEach
34. no-continue — continue inside for...of in css-analyzer.js — replace with
return inside forEach
35. prefer-destructuring — const prop = style[i] in css-analyzer.js
36. prefer-destructuring — const size = new Blob([cssText]).size in
css-analyzer.js
37. no-empty — empty catch {} block in css-analyzer.js — add comment
Stylelint
38. CSS property ordering not matching Drupal's expected order in admin.css
39. Single-line declarations not expanded to multi-line format in admin.css
40. Prettier formatting inconsistencies in admin.css
Comments
Comment #2
zeeshan_khan commentedhttps://git.drupalcode.org/project/css_usage_analyzer/-/merge_requests/2 Fixed all the issues