Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Code Sniffer reports several errors, but I consider all of those to be false positives/invalid:
FILE: .../modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
185 | ERROR | Using the e flag in preg_match is a possible security risk. For
| | details see http://drupal.org/node/750148
--------------------------------------------------------------------------------
FILE: .../drupal8.local/public_html/core/modules/statistics/statistics.admin.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
318 | ERROR | If the line declaring an array spans longer than 80 characters,
| | each element should be broken into its own line
--------------------------------------------------------------------------------
In my opinion, changing this would not do anything for readability. It would actually harm it.
FILE: ...dev/drupal8.local/public_html/core/modules/statistics/statistics.module
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
32 | ERROR | If the line declaring an array spans longer than 80 characters,
| | each element should be broken into its own line
327 | ERROR | If the line declaring an array spans longer than 80 characters,
| | each element should be broken into its own line
--------------------------------------------------------------------------------
Line 32: All the output in the top is difficult to make readable, but I think it's alright the way it is.
Line 327: Same as previous file.
There isn't any state of the coder module right now, which makes it possible to review the code with coder. See https://www.drupal.org/node/2182043#comment-9208083. Have you reviewed the statistics module anyhow by command line?
Comments
Comment #1
NROTC_Webmaster CreditAttribution: NROTC_Webmaster commentedPostponed because of #1313510: Clean up API docs for statistics module
Comment #2
theduke CreditAttribution: theduke commentedI'm taking this on.
Patch attached.
Coder reports no problems.
Code Sniffer reports several errors, but I consider all of those to be false positives/invalid:
This seems to be an error in Drupal Code Sniffer.
See http://drupal.org/node/1779020
In my opinion, changing this would not do anything for readability. It would actually harm it.
Line 32: All the output in the top is difficult to make readable, but I think it's alright the way it is.
Line 327: Same as previous file.
Comment #3
theduke CreditAttribution: theduke commentedComment #4
TravisCarden CreditAttribution: TravisCarden commentedPostponing till feature freeze. If you want to help in the meantime, please work on the blockers on the meta issue. Thanks!
Comment #5
sphism CreditAttribution: sphism commentedWe have the go ahead with all these issues again, see #1518116: [meta] Make Core pass Coder Review for more details
Comment #6
visabhishek CreditAttribution: visabhishek commentedI have created a patch. Please review.
Comment #7
visabhishek CreditAttribution: visabhishek commentedI have updated this patch as per https://drupal.org/comment/8601579#comment-8601579.
Comment #8
Peter MajmeskuI'm reviewing the latest state of the core according to this issue now.
Comment #9
Peter Majmesku*deleted because duplication*
Comment #10
Peter MajmeskuThere isn't any state of the coder module right now, which makes it possible to review the code with coder. See https://www.drupal.org/node/2182043#comment-9208083. Have you reviewed the statistics module anyhow by command line?
Comment #11
xjmThanks for all the work here so far. See #1518116-86: [meta] Make Core pass Coder Review. This issue is postponed until the meta issue is either closed or reopened.
Comment #12
tatarbjClosing in favor of #2571965: [meta] Fix PHP coding standards in core. In this issue the coding standards will be fixed on a sniff-per-sniff basis rather than a module-per-module basis.