vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/views_cumulative_field/

FILE: .../contrib/views_cumulative_field/src/Plugin/views/field/CumulativeField.php
--------------------------------------------------------------------------------
FOUND 25 ERRORS AFFECTING 17 LINES
--------------------------------------------------------------------------------
9 | ERROR | [x] There must be one blank line after the last USE statement; 2
| | found;
35 | ERROR | [ ] Missing parameter comment
36 | ERROR | [ ] Missing parameter comment
36 | ERROR | [ ] Missing parameter type
37 | ERROR | [ ] Missing parameter comment
37 | ERROR | [ ] Missing parameter type
38 | ERROR | [ ] Missing parameter comment
45 | ERROR | [ ] Missing member variable doc comment
86 | ERROR | [ ] Missing parameter comment
86 | ERROR | [ ] Missing parameter type
88 | ERROR | [ ] Description for the @return value is missing
105 | ERROR | [ ] Missing parameter comment
105 | ERROR | [ ] Missing parameter type
107 | ERROR | [ ] Description for the @return value is missing
124 | ERROR | [ ] Missing parameter comment
124 | ERROR | [ ] Missing parameter type
126 | ERROR | [ ] Description for the @return value is missing
140 | ERROR | [ ] Missing short description in doc comment
141 | ERROR | [ ] Missing parameter comment
141 | ERROR | [ ] Missing parameter type
142 | ERROR | [ ] Missing parameter comment
142 | ERROR | [ ] Missing parameter type
143 | ERROR | [ ] Missing parameter comment
143 | ERROR | [ ] Missing parameter type
145 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...eb/modules/contrib/views_cumulative_field/views_cumulative_field.views.inc
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
17 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
17 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
18 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | TRUE
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 402ms; Memory: 12MB

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dineshkumarbollu created an issue. See original summary.

dineshkumarbollu’s picture

I will work on this issue.

dineshkumarbollu’s picture

Assigned: dineshkumarbollu » Unassigned
Status: Active » Needs review
FileSize
4.81 KB
skt-001’s picture

FileSize
1.18 MB

thanks @dineshkumarbollu for the patch. Applied successfully and fixes all PHPCS error.
sharing the SS.

skt-001’s picture

Status: Needs review » Reviewed & tested by the community
apaderno’s picture

Priority: Normal » Minor
Issue tags: -Fix the issues reported by phpcs +Coding standards
apaderno’s picture

Status: Reviewed & tested by the community » Needs work

The patch could apply, but it is not correct.

-   * @param $plugin_id
-   * @param $plugin_definition
+   *   The array of values.
+   * @param int $plugin_id
+   *   The Plugin_id value.
+   * @param string $plugin_definition
+   *   Definition of Plugin.

array of values is too generic for that parameter.
Plugin_id is not an English word.
The last line is missing an article and misspelling Plugin, since that word is not at the sentence beginning.

    * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   EntityTypeMangager service.

There is still a missing article.
The service name is also misspelled.
The entity type manager. is a better description; there is no need to say that a manager is a service, since in Drupal that is normal.

    * @return string
+   *   Return the value of type string

That description does not make sense. Furthermore, saying that the returned value is a string (which I guess is what that comment is supposed to say) is quite vague and useless, since that is information already given from the parameter type-hinting. The correct description should say what exactly the returned value is, not its type.

-   * @param $field
+   * @param string $field
+   *   Define field value.

That is a too generic description.

    * @return mixed
+   *   Reurns the value of Mixed

There is a typo.
value of Mixed does not make sense and it does not say what the method returns.

+   * @param array $values
+   *   The array of values.
+   * @param string $field
+   *   Define field value.
+   * @param string $relationship
+   *   Define relationship value.

Those descriptions are not helpful at all.
It is not that, for a $random_value parameter, the description can be Define random_value value. because that is wrong and too generic.

+/**
+ * @file
+ * Define the Hooks of the module.
+ */
+

The usual comment is Hook implementations for the [module name] module.
Hooks is misspelled, since it is not at the beginning of the sentence.

shalini_jha made their first commit to this issue’s fork.

shalini_jha’s picture

Assigned: Unassigned » shalini_jha

I will work on this issue.

shalini_jha’s picture

Assigned: shalini_jha » Unassigned
Status: Needs work » Needs review
FileSize
5.19 KB

Added the patch for fixes of listed issues. please review.

djsagar’s picture

Hi @all,

After applied patch #10, all phpcs issue are fixed.

RTBC ++

elber’s picture

Status: Needs review » Reviewed & tested by the community

Hi I also reviewed it.

Patch applies cleanly.

I ran phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml

All the phpcs errors has been removed.

Module keeps good.

Moving to RTBC.

apaderno’s picture

Status: Reviewed & tested by the community » Needs work
    * @param array $configuration
-   * @param $plugin_id
-   * @param $plugin_definition
+   *   An array of configuration used by the plugin.
+   * @param int $plugin_id
+   *   The plugin_id for the handler.
+   * @param string $plugin_definition
+   *   The plugin implementation definition.

The type and description of the first three parameters need to be:

  • array $configuration: A configuration array containing information about the plugin instance.
  • string $plugin_id: The plugin ID.
  • mixed $plugin_definition: The plugin implementation definition.
    * Determine if the field comes from a relationship.
    *
-   * @param $field
+   * @param string $field
+   *   The name of the field for which to retrieve the relationship.
   /**
    * Determine if the field is rewritten/altered.
    *
-   * @param $field
+   * @param string $field
+   *   The name of the field to retrieve the rewrite status.
    *
    * @return mixed
+   *   The rewrite status for the provided field,which can be mixed value.
    */

Since those documentation comments are changed, Determine must be declined on the third person singular.

-   * @param $values
-   * @param $field
-   * @param $relationship
+   * Defining the values.
+   *
+   * @param array $values
+   *   An array of values used by the plugin.
+   * @param string $field
+   *   The name of the field to retrieve the relationship entity.
+   * @param string $relationship
+   *   The name of the relationship to retrieve.
    *
    * @return \Drupal\Core\Entity\EntityInterface|null
+   *   An entity representing the relationship, or null if not found.
+   *
    * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
    * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
    */
-  protected function getRelationshipEntity($values, $field, $relationship) {
+  protected function getRelationshipEntity(array $values, $field, $relationship) {

Defining the values. is not the correct description for a getRelationshipEntity() method.

+/**
+ * @file
+ * Hook implementations for the views_cumulative_field module.

views_cumulative_field must be replaced from the module name, which is different from the module machine name.

+      // Allow users to specify how precise the results should be.
+      // Useful for divisions.

Allow must be declined on the third person singular.
The other sentence is missing verb and subject (It is).

bindu r made their first commit to this issue’s fork.

Yashaswi18 made their first commit to this issue’s fork.

Yashaswi18’s picture

FileSize
5.36 KB

Addressed above comments in this patch. Please review.

Yashaswi18’s picture

Status: Needs work » Needs review
Shank115’s picture

I applied patch provided in #16, applies cleanly. Ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig views_cumulative_field/, found no phpcs errors.

Checking patch src/Plugin/views/field/CumulativeField.php...
Checking patch views_cumulative_field.views.inc...
Applied patch src/Plugin/views/field/CumulativeField.php cleanly.
Applied patch views_cumulative_field.views.inc cleanly.
andileco’s picture

Status: Needs review » Needs work

Would someone please make a merge request from the latest patch? The code looks good, but I like to see the pipeline results that run on merge requests.

pray_12 made their first commit to this issue’s fork.

pray_12’s picture

Status: Needs work » Needs review

  • andileco committed ef58b067 on 2.0.x authored by pray_12
    Issue #3353889 by Yashaswi18, shalini_jha, dineshkumarbollu, pray_12,...
andileco’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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