Problem/Motivation

FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/smart_title/modules/smart_title_ui/src/Form/SmartTitleConfigForm.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------
  20 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 170 | ERROR   | [x] list(...) is forbidden, use [...] instead.
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/smart_title/src/EntityViewDisplayAlterer.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 209 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 211 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
 216 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

Time: 310ms; Memory: 12MB

Steps to reproduce

Run following command
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info smart_title

Proposed resolution

The above error needs to be fixed.

Command icon 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

Rohit Rana created an issue. See original summary.

rohit rana’s picture

StatusFileSize
new2.1 KB
rohit rana’s picture

Assigned: rohit rana » Unassigned
Status: Active » Needs review
omkar_yewale’s picture

Assigned: Unassigned » omkar_yewale
omkar_yewale’s picture

Title: Errors Find By Phpcs » Fix the issues reported by phpcs
Assigned: omkar_yewale » Unassigned
Status: Needs review » Needs work
Issue tags: +Coding standards

Hi, @rohit Patch applied but still getting these issues.

FILE: /smart_title/smart_title.module
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR
--------------------------------------------------------------------------------------------------------------------------------
78 | ERROR | [x] list(...) is forbidden, use [...] instead.
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------

FILE: /smart_title/smart_title.install
---------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------
32 | ERROR | [x] list(...) is forbidden, use [...] instead.
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------

omkar_yewale’s picture

Status: Needs work » Needs review

Please review the !1 MR for all of the issues listed above and those that remain.

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update
 /**
- * SmartTitleConfigForm.
+ * Configure smart title settings.
  */

The verb needs to use the Simple Present tense and the third person singular.

-  // @TODO: (add alter || convert to config) && validate.
+  // @todo (add alter || convert to config) && validate.

That needs to be changed in a sentence too.

  * @return string[][]|string[]|string
  *   An array of smart title default setting values or the value of the
  *   specificed option.
- *
- * @TODO
  */

That is probably a call for the maintainers, since they know if the code of that method is complete or there is something that needs to be changed or added.

The 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.

omkar_yewale’s picture

Issue summary: View changes
Status: Needs work » Needs review

Thank you for your feedback, MR and issue description updated.
Please review.

I'm skipping this issue for now.
/smart_title/smart_title.module
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
222 | WARNING | '@todo' should match the format '@todo Fix problem X here.'
--------------------------------------------------------------------------------

ashutosh ahirwal’s picture

Issue tags: +Novice
StatusFileSize
new2.33 KB

Providing Patch with fixes of Drupal, DrupalPractice
Thanku

avpaderno’s picture

The last patch is not correct, as it does not fix what reported in previous comments. The MR is correct, for what I can see.

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update, -Novice

The status change is for what committed in the MR.

huzooka’s picture

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Reviewed & tested by the community » Needs work

I hope you don't mind if I also fix the spelling issues here.

huzooka’s picture

Status: Needs work » Needs review

Let's see what the CI process says... Should be all green.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs review » Fixed

Thank you all!

  • huzooka committed 59191c81 on 8.x-1.x authored by omkar_yewale
    Issue #3318157 by omkar_yewale, huzooka, Rohit Rana, apaderno: Fix the...

Status: Fixed » Closed (fixed)

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