before cutting an alpha or beta release, we should fix all the code style issues. There are a number of things that are being worked on currently, once those are complete and have been merged in, I will go through and update the coding style.

http://pareview.sh/pareview/httpgitdrupalorgprojectseckitgit-8x-1x

H

Comments

kmoll created an issue. See original summary.

naveenvalecha’s picture

Assigned: kmoll » Unassigned
Priority: Normal » Minor
Issue summary: View changes
Issue tags: +Novice, +Coding standards

.

sneha_surve’s picture

Assigned: Unassigned » sneha_surve
sneha_surve’s picture

Assigned: sneha_surve » Unassigned
Status: Active » Needs review
StatusFileSize
new48.63 KB

Made changes according to Drupal coding standards!
Thanks!

Status: Needs review » Needs work

The last submitted patch, 4: fix-coding-2715611-4.patch, failed testing.

sneha_surve’s picture

Status: Needs work » Needs review
shruti1803’s picture

Assigned: Unassigned » shruti1803
Status: Needs review » Needs work
naveenvalecha’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new42.97 KB

Heres the patch that would fix coding standards automatically using
phpcbf --standard=Drupal seckit/

shruti1803’s picture

Assigned: shruti1803 » Unassigned
Status: Needs review » Needs work

Hi 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!

naveenvalecha’s picture

Go ahead and fix the rest of the standards
// Naveen

rasikap’s picture

Assigned: Unassigned » rasikap
rasikap’s picture

Assigned: rasikap » Unassigned
Status: Needs work » Needs review
StatusFileSize
new64.27 KB
kmoll’s picture

StatusFileSize
new76.28 KB
new36.39 KB

There were still some issues I found with phpcs --standard=Drupal --extensions=php,module.

I fixed those and with that command it now passes.

naveenvalecha’s picture

Status: Needs review » Needs work

Thanks!

  1. +++ b/src/EventSubscriber/SecKitEventSubscriber.php
    @@ -27,44 +30,59 @@ class SecKitEventSubscriber implements EventSubscriberInterface {
    +   * Class constructor.
    

    This should be "Constructs an SecKitEventSubscriber object."

  2. +++ b/src/EventSubscriber/SecKitEventSubscriber.php
    @@ -145,30 +162,30 @@ class SecKitEventSubscriber implements EventSubscriberInterface {
    +    // else {.
    

    '.' this is not needed at end

naveenvalecha’s picture

Status: Needs work » Reviewed & tested by the community

#14 can be addressed at commit as well.

kmoll’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new76.22 KB
new855 bytes

fixed those two minor issues. Should be good to commit as is now.

naveenvalecha’s picture

Status: Needs review » Reviewed & tested by the community

back to RTBC Thanks!

jribeiro’s picture

+1 RTBC

badjava’s picture

Assigned: Unassigned » badjava

I will look at this asap.

  • badjava committed ccbd929 on 8.x-1.x authored by kmoll
    Issue #2715611 by kmoll, naveenvalecha, sneha_surve, rasikap, shruti1803...
badjava’s picture

Assigned: badjava » Unassigned
Status: Reviewed & tested by the community » Fixed

Thank you everyone for resolving this issue!

naveenvalecha’s picture

Thanks!

6 files changed, 396 insertions(+), 358 deletions(-)

Status: Fixed » Closed (fixed)

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