Code sniffer gives a bunch of errors & warnings:

~/S/n/w/m/c/flood_unblock ❯❯❯ fin phpcs cs ./ ✘ 1

FILE: /var/www/web/modules/contrib/flood_unblock/flood_unblock.module
----------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
20 | WARNING | [ ] Only string literals should be passed to t() where possible
35 | ERROR | [x] Expected 1 space after "="; 2 found
57 | WARNING | [x] A comma should follow the last multiline array item. Found: )
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: /var/www/web/modules/contrib/flood_unblock/tests/src/Functional/FloodUnblockUiPageTest.php
------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------
3 | ERROR | [x] There must be one blank line after the namespace declaration
25 | ERROR | [ ] Missing @var tag in member variable comment
26 | ERROR | [ ] Class property $admin_user should use lowerCamel naming without underscores
30 | ERROR | [ ] Missing @var tag in member variable comment
31 | ERROR | [ ] Class property $simple_user should use lowerCamel naming without underscores
33 | ERROR | [x] Missing function doc comment
45 | ERROR | [x] Missing function doc comment
56 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------

FILE: /var/www/web/modules/contrib/flood_unblock/src/FloodUnblockManager.php
-------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 15 LINES
-------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Missing class doc comment
17 | ERROR | [x] Doc comment short description must end with a full stop
23 | ERROR | [ ] Missing short description in doc comment
28 | ERROR | [ ] Missing short description in doc comment
33 | ERROR | [ ] Missing short description in doc comment
45 | ERROR | [ ] Parameter $flood is not described in comment
45 | ERROR | [ ] Parameter $configFactory is not described in comment
45 | ERROR | [ ] Parameter $messenger is not described in comment
48 | ERROR | [ ] Missing parameter comment
49 | ERROR | [ ] Missing parameter comment
65 | ERROR | [ ] Public method name "FloodUnblockManager::get_blocked_ip_entries" is not in lowerCamel format
107 | ERROR | [ ] Public method name "FloodUnblockManager::get_blocked_user_entries" is not in lowerCamel format
141 | ERROR | [x] Expected newline after closing brace
163 | ERROR | [ ] Public method name "FloodUnblockManager::flood_unblock_clear_event" is not in lowerCamel format
175 | ERROR | [x] Expected newline after closing brace
182 | ERROR | [x] Expected 1 blank line after function; 0 found
183 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: /var/www/web/modules/contrib/flood_unblock/src/Commands/FloodUnblockCommands.php
--------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------
12 | ERROR | [x] Opening brace should be on the same line as the declaration
14 | ERROR | [ ] Missing short description in doc comment
15 | ERROR | [x] Data types in @var tags need to be fully namespaced
22 | ERROR | [ ] Missing parameter comment
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: /var/www/web/modules/contrib/flood_unblock/src/Form/FloodUnblockAdminForm.php
---------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
---------------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
17 | ERROR | [ ] Missing short description in doc comment
22 | ERROR | [ ] Missing short description in doc comment
27 | ERROR | [x] Missing function doc comment
119 | ERROR | [x] Expected 1 blank line after function; 2 found
159 | ERROR | [x] Expected 1 blank line after function; 0 found
160 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------

Time: 4.21 secs; Memory: 10MB

Comments

batigolix created an issue. See original summary.

batigolix’s picture

Title: fix code sniffing warnings & errors » Fix code sniffer warnings & errors
Pooja Ganjage’s picture

StatusFileSize
new25.8 KB

Hi,

I am applying patch for coding standards.

Kindly review this patch once.

Thanks.

Pooja Ganjage’s picture

Status: Active » Needs review
batigolix’s picture

Many thanks @pooja
I'll commit this when #3124512: Failed REST logins can only be cleared via Drush (not GUI) is done.

batigolix’s picture

Status: Needs review » Needs work

Pooja Ganjage:
FloodUnblockManager.php has changed quite a bit since #3124512: Failed REST logins can only be cleared via Drush (not GUI)

You want to make a new patch?

nitesh624’s picture

Working on it , will update shortly

nitesh624’s picture

StatusFileSize
new8.98 KB
new32.62 KB
nitesh624’s picture

Status: Needs work » Needs review
fabianderijk’s picture

Thanks, this seems to be ok. I'm applying the patch

fabianderijk’s picture

Status: Needs review » Fixed

This is now fixed in the 3.0.x branch

Pooja Ganjage’s picture

Status: Fixed » Closed (fixed)

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