Problem/Motivation
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/viewfield.module
-------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 3 WARNINGS AFFECTING 9 LINES
-------------------------------------------------------------------------------------------------
20 | ERROR | [ ] The array declaration extends to column 1052 (the limit is 80). The array content should be split up over multiple lines
100 | ERROR | [x] Use null coalesce operator instead of ternary operator.
105 | ERROR | [x] Use null coalesce operator instead of ternary operator.
107 | ERROR | [x] Use null coalesce operator instead of ternary operator.
110 | ERROR | [ ] Comment indentation error, expected only 1 spaces
111 | ERROR | [ ] Comment indentation error, expected only 2 spaces
114 | WARNING | [ ] Line exceeds 80 characters; contains 124 characters
114 | ERROR | [ ] Comment indentation error, expected only 1 spaces
115 | WARNING | [ ] Line exceeds 80 characters; contains 128 characters
115 | ERROR | [ ] Comment indentation error, expected only 2 spaces
136 | WARNING | [ ] Line exceeds 80 characters; contains 188 characters
136 | ERROR | [ ] Comment indentation error, expected only 1 spaces
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/tests/src/FunctionalJavascript/ViewfieldFormatterTest.php
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------
46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
85 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
129 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
176 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
222 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/tests/src/FunctionalJavascript/ViewfieldFunctionalTestBase.php
------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------
32 | ERROR | [ ] Missing @var tag in member variable comment
64 | ERROR | [ ] The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
165 | ERROR | [x] Expected 1 blank line after function; 2 found
168 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/tests/src/FunctionalJavascript/ViewfieldWidgetTest.php
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------
26 | WARNING | [ ] Unused variable $page.
50 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
58 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/tests/src/Kernel/ViewfieldKernelTest.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 18 WARNINGS AFFECTING 13 LINES
------------------------------------------------------------------------------------------------------------------------------
28 | ERROR | [ ] Missing @var tag in member variable comment
31 | ERROR | [x] Missing function doc comment
32 | WARNING | [x] 'TODO: Change the autogenerated stub' should match the format '@todo Fix problem X here.'
32 | WARNING | [ ] There must be no blank line following an inline comment
32 | ERROR | [x] Comments may not appear after statements
32 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
59 | ERROR | [x] Missing function doc comment
60 | WARNING | [x] There must be no blank line following an inline comment
60 | WARNING | [ ] There must be no blank line following an inline comment
62 | WARNING | [x] There must be no blank line following an inline comment
62 | WARNING | [ ] There must be no blank line following an inline comment
64 | WARNING | [x] There must be no blank line following an inline comment
64 | WARNING | [ ] There must be no blank line following an inline comment
66 | WARNING | [x] There must be no blank line following an inline comment
66 | WARNING | [ ] There must be no blank line following an inline comment
68 | WARNING | [x] There must be no blank line following an inline comment
68 | WARNING | [ ] There must be no blank line following an inline comment
70 | WARNING | [x] There must be no blank line following an inline comment
70 | WARNING | [ ] There must be no blank line following an inline comment
72 | WARNING | [x] There must be no blank line following an inline comment
72 | WARNING | [ ] There must be no blank line following an inline comment
74 | WARNING | [x] There must be no blank line following an inline comment
74 | WARNING | [ ] There must be no blank line following an inline comment
78 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/viewfield.libraries.yml
------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/README.txt
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
54 | WARNING | Line exceeds 80 characters; contains 81 characters
-----------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/viewfield.install
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
128 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/src/ViewfieldServiceProvider.php
---------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Doc comment short description must end with a full stop
22 | ERROR | [x] Short array syntax must be used to define arrays
26 | ERROR | [x] Short array syntax must be used to define arrays
31 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/src/Plugin/Field/FieldWidget/ViewfieldWidgetSelect.php
----------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------------------------
92 | ERROR | [x] Expected 1 space after "="; 2 found
111 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
115 | ERROR | [x] Concat operator must be surrounded by a single space
116 | ERROR | [x] Concat operator must be surrounded by a single space
163 | ERROR | [x] Whitespace found at end of line
244 | ERROR | [x] Missing function doc comment
245 | WARNING | [ ] Line exceeds 80 characters; contains 108 characters
245 | WARNING | [x] 'TODO: Change the autogenerated stub' should match the format '@todo Fix problem X here.'
245 | ERROR | [x] Comments may not appear after statements
245 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
246 | WARNING | [ ] Unused variable $key.
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/src/Plugin/Field/FieldType/ViewfieldItem.php
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
138 | ERROR | [ ] The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------
FILE: ~/projects/drupal-d10/modules/contrib/viewfield/src/Plugin/Field/FieldFormatter/ViewfieldFormatterDefault.php
-----------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------
154 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
162 | ERROR | [x] Expected 1 space after IF keyword; 0 found
249 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------
Time: 251ms; Memory: 12MB
Steps to reproduce
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml viewfield
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 3127062-MR-6-Before-Apply.png | 2.43 MB | rassoni |
| #20 | 3127062-MR-6-After-Apply.png | 683.53 KB | rassoni |
Issue fork viewfield-3127062
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
maithri shetty commentedComment #4
maithri shetty commentedComment #5
rassoni commentedComment #7
rassoni commentedFixed failed issue.
Comment #9
maithri shetty commentedComment #11
rassoni commentedComment #12
rassoni commentedComment #13
jerdavisThe patch is failing to apply
Comment #14
maithri shetty commentedComment #15
indrapatil commentedPatch failed
dell@indra-latitude-5480:/var/www/html/drupal-8/viewfield(8.x-3.x)$ git apply 3127062-8.patch
error: patch failed: tests/src/Kernel/ViewfieldKernelTest.php:23
error: tests/src/Kernel/ViewfieldKernelTest.php: patch does not apply
So moving to needs work.
Comment #16
mrinalini9 commentedRerolled patch #14, please review it.
Comment #19
vladimirausRerolled as MR and fixed everything except
Comment #20
rassoni commentedMR 6 review and tested locally and PHPCS issues are resolved. Please check the screenshot for reference.
Comment #21
rassoni commentedComment #22
avpadernoThe issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.
Comment #23
rassoni commentedComment #24
avpadernoComment #25
vladimirausComment #26
avpadernoOnly the first word in the description must be capitalized.
The class is not correct; the class is
ViewfieldFormatterDefault.The description for a constructor must start with
Constructs a newfollowed by the class name (including its namespace), and end withobject.That comment can be removed, since it describes something already clear from the code.
+ // @todo Change the autogenerated stubThe period at the end is missing.
That description does not say what the class does.
Only the first word must be capitalized.
Comment #27
avpadernoComment #28
nitin_lamaComment #29
nitin_lamaComment #31
sakthi_dev commentedUpdated the MR with the changes mentioned in #26. Please review.
Comment #32
avpadernoThat comment can be removed, since it describes something already clear from the code.
There is a typo in that description, which does not make sense.
The verb must use the third singular person.
The description should be rewritten: Four attributive nouns are too much.
Even if commented out, that is still code. The existing line are correctly indented; the changed code is not correctly indented.
Code lines can exceed 80 characters, if they are more readable. That is still valid for commented out code.
Comment #33
nitin_lamaComment #34
nitin_lama