Closed (fixed)
Project:
Security Kit
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Apr 2016 at 21:18 UTC
Updated:
18 Oct 2016 at 05:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
naveenvalecha.
Comment #3
sneha_surve commentedComment #4
sneha_surve commentedMade changes according to Drupal coding standards!
Thanks!
Comment #6
sneha_surve commentedComment #7
shruti1803 commentedComment #8
naveenvalechaHeres the patch that would fix coding standards automatically using
phpcbf --standard=Drupal seckit/Comment #9
shruti1803 commentedHi naveenvalecha,
I have applied your patch given in #8. Found some errors needs to be fixed.
FILE: ...ml/drupal/modules/contrib/seckit/src/Tests/SecKitCSPCaseTest.php
----------------------------------------------------------------------
FOUND 5 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------
25 | ERROR | Class property $report_path should use lowerCamel
| | naming without underscores
62 | ERROR | Public method name
| | "SecKitCSPCaseTest::testCSPHasAllDirectives" is not
| | in lowerCamel format
89 | ERROR | Doc comment short description must be on a single
| | line, further text should be a separate paragraph
107 | WARNING | Line exceeds 80 characters; contains 86 characters
109 | WARNING | Line exceeds 80 characters; contains 82 characters
111 | WARNING | Line exceeds 80 characters; contains 84 characters
120 | ERROR | Doc comment short description must be on a single
| | line, further text should be a separate paragraph
122 | ERROR | Public method name
| | "SecKitCSPCaseTest::testCSPAllDirectivesEmpty" is
| | not in lowerCamel format
----------------------------------------------------------------------
FILE: ...l/drupal/modules/contrib/seckit/src/Tests/SecKitTestCaseTest.php
----------------------------------------------------------------------
FOUND 19 ERRORS AND 4 WARNINGS AFFECTING 23 LINES
----------------------------------------------------------------------
25 | ERROR | Class property $report_path should use lowerCamel
| | naming without underscores
63 | ERROR | Public method name
| | "SecKitTestCaseTest::testDisabledCSP" is not in
| | lowerCamel format
77 | ERROR | Public method name
| | "SecKitTestCaseTest::testCSPHasAllDirectives" is not
| | in lowerCamel format
104 | ERROR | Doc comment short description must be on a single
| | line, further text should be a separate paragraph
122 | WARNING | Line exceeds 80 characters; contains 86 characters
124 | WARNING | Line exceeds 80 characters; contains 82 characters
126 | WARNING | Line exceeds 80 characters; contains 84 characters
134 | ERROR | Doc comment short description must be on a single
| | line, further text should be a separate paragraph
136 | ERROR | Public method name
| | "SecKitTestCaseTest::testCSPAllDirectivesEmpty" is
| | not in lowerCamel format
168 | WARNING | Line exceeds 80 characters; contains 86 characters
181 | ERROR | Public method name
| | "SecKitTestCaseTest::testXXSSProtectionIsDisabled"
| | is not in lowerCamel format
191 | ERROR | Public method name
| | "SecKitTestCaseTest::testXXSSProtectionIs0" is not
| | in lowerCamel format
201 | ERROR | Public method name
| | "SecKitTestCaseTest::testXXSSProtectionIs1" is not
| | in lowerCamel format
211 | ERROR | Public method name
| | "SecKitTestCaseTest::testXXSSProtectionIs1Block" is
| | not in lowerCamel format
221 | ERROR | Public method name
| | "SecKitTestCaseTest::testDisabledXContentTypeOptions"
| | is not in lowerCamel format
231 | ERROR | Public method name
| | "SecKitTestCaseTest::testEnabledXContentTypeOptions"
| | is not in lowerCamel format
283 | ERROR | Public method name
| | "SecKitTestCaseTest::testXFrameOptionsIsDisabled" is
| | not in lowerCamel format
293 | ERROR | Public method name
| | "SecKitTestCaseTest::testXFrameOptionsIsSameOrigin"
| | is not in lowerCamel format
303 | ERROR | Public method name
| | "SecKitTestCaseTest::testXFrameOptionsIsDeny" is not
| | in lowerCamel format
313 | ERROR | Public method name
| | "SecKitTestCaseTest::testXFrameOptionsIsAllowFrom"
| | is not in lowerCamel format
324 | ERROR | Public method name
| | "SecKitTestCaseTest::testJSCSSNoscript" is not in
| | lowerCamel format
354 | ERROR | Public method name
| | "SecKitTestCaseTest::testDisabledHSTS" is not in
| | lowerCamel format
364 | ERROR | Public method name
| | "SecKitTestCaseTest::testHSTSAllDirectves" is not in
| | lowerCamel format
----------------------------------------------------------------------
FILE: ...les/contrib/seckit/src/EventSubscriber/SecKitEventSubscriber.php
----------------------------------------------------------------------
FOUND 15 ERRORS AND 4 WARNINGS AFFECTING 19 LINES
----------------------------------------------------------------------
12 | ERROR | Doc comment is empty
33 | ERROR | Doc comment is empty
40 | ERROR | Doc comment is empty
52 | ERROR | Doc comment is empty
77 | WARNING | Line exceeds 80 characters; contains 81 characters
104 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_origin" is not in
| | lowerCamel format
146 | WARNING | Only string literals should be passed to t() where
| | possible
160 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_csp" is not in
| | lowerCamel format
247 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_x_xss" is not in
| | lowerCamel format
274 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_x_content_type_options"
| | is not in lowerCamel format
289 | WARNING | Line exceeds 80 characters; contains 82 characters
292 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_x_frame" is not in
| | lowerCamel format
322 | ERROR | Doc comment is empty
336 | WARNING | Line exceeds 80 characters; contains 92 characters
338 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_js_css_noscript" is
| | not in lowerCamel format
351 | ERROR | Description for the @return value is missing
353 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_get_js_css_noscript_code"
| | is not in lowerCamel format
384 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_hsts" is not in
| | lowerCamel format
406 | ERROR | Public method name
| | "SecKitEventSubscriber::_seckit_from_origin" is not
| | in lowerCamel format
----------------------------------------------------------------------
FILE: ...ml/drupal/modules/contrib/seckit/src/Form/SecKitSettingsForm.php
----------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
----------------------------------------------------------------------
14 | ERROR | Doc comment short description must start with a
| | capital letter
28 | ERROR | Doc comment short description must start with a
| | capital letter
199 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
328 | ERROR | If the line declaring an array spans longer than 80
| | characters, each element should be broken into its own
| | line
598 | ERROR | Public method name "SecKitSettingsForm::_getItemsList"
| | is not in lowerCamel format
615 | ERROR | If the line declaring an array spans longer than 80
| | characters, each element should be broken into its own
| | line
629 | ERROR | Doc comment short description must be on a single
| | line, further text should be a separate paragraph
631 | ERROR | Protected method name
| | "SecKitSettingsForm::_seckit_explode_value" is not in
| | lowerCamel format
----------------------------------------------------------------------
FILE: /var/www/html/drupal/modules/contrib/seckit/seckit.module
----------------------------------------------------------------------
FOUND 11 ERRORS AND 5 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one
| | blank line
12 | ERROR | [x] Comments may not appear after statements
12 | ERROR | [x] Inline comments must start with a capital letter
13 | ERROR | [x] Comments may not appear after statements
14 | WARNING | [ ] Line exceeds 80 characters; contains 87
| | characters
14 | ERROR | [x] Comments may not appear after statements
15 | ERROR | [x] Comments may not appear after statements
16 | ERROR | [x] Comments may not appear after statements
17 | WARNING | [ ] Line exceeds 80 characters; contains 88
| | characters
17 | ERROR | [x] Comments may not appear after statements
18 | ERROR | [x] Comments may not appear after statements
19 | WARNING | [ ] Line exceeds 80 characters; contains 88
| | characters
19 | ERROR | [x] Inline comments must end in full-stops,
| | exclamation marks, colons, question marks, or
| | closing parentheses
19 | ERROR | [x] Comments may not appear after statements
23 | WARNING | [ ] Format should be "* Implements hook_foo().", "*
| | Implements hook_foo_BAR_ID_bar() for
| | xyz_bar().",, "* Implements hook_foo_BAR_ID_bar()
| | for xyz-bar.html.twig.", or "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.".
30 | WARNING | [ ] Format should be "* Implements hook_foo().", "*
| | Implements hook_foo_BAR_ID_bar() for
| | xyz_bar().",, "* Implements hook_foo_BAR_ID_bar()
| | for xyz-bar.html.twig.", or "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.".
----------------------------------------------------------------------
Thanks!
Comment #10
naveenvalechaGo ahead and fix the rest of the standards
// Naveen
Comment #11
rasikap commentedComment #12
rasikap commentedComment #13
kmoll commentedThere were still some issues I found with
phpcs --standard=Drupal --extensions=php,module.I fixed those and with that command it now passes.
Comment #14
naveenvalechaThanks!
This should be "Constructs an SecKitEventSubscriber object."
'.' this is not needed at end
Comment #15
naveenvalecha#14 can be addressed at commit as well.
Comment #16
kmoll commentedfixed those two minor issues. Should be good to commit as is now.
Comment #17
naveenvalechaback to RTBC Thanks!
Comment #18
jribeiro commented+1 RTBC
Comment #19
badjava commentedI will look at this asap.
Comment #21
badjava commentedThank you everyone for resolving this issue!
Comment #22
naveenvalechaThanks!
6 files changed, 396 insertions(+), 358 deletions(-)