Problem/Motivation

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/tests/modules/charts_test/charts_test.routing.yml
---------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
 7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
---------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/tests/modules/charts_test/src/Plugin/chart/Library/ChartsTestLibrary.php
--------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------
 79 | ERROR | [x] Concat operator must be surrounded by a single space
--------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/tests/src/Traits/ConfigUpdateTrait.php
----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------
  5 | ERROR | [x] Missing trait doc comment
  7 | ERROR | [ ] Parameter $library is not described in comment
 13 | ERROR | [ ] If there is no return value for a function, there must not be a @return tag.
 13 | ERROR | [ ] Description for the @return value is missing
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/tests/src/FunctionalJavascript/DataCollectorTableTest.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 70 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/tests/src/Kernel/ChartsKernelTestBase.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------
 15 | ERROR | [x] Doc comment short description must end with a full stop
 49 | ERROR | [ ] Missing parameter type
 59 | ERROR | [ ] Missing short description in doc comment
 61 | ERROR | [ ] Missing parameter comment
 63 | ERROR | [ ] Description for the @return value is missing
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/tests/src/Kernel/ChartElementTest.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------
  5 | WARNING | [x] Unused use statement
  7 | WARNING | [x] Unused use statement
 50 | ERROR   | [x] Expected one space after the comma, 0 found
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/tests/src/Kernel/DimensionsTest.php
-------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------
 25 | ERROR | [ ] Parameter tags must be defined first in a doc comment
 60 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 61 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 62 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 63 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 64 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/README.md
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------
 213 | WARNING | Line exceeds 80 characters; contains 115 characters
 214 | WARNING | Line exceeds 80 characters; contains 105 characters
-----------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_c3/README.md
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 124 | WARNING | Line exceeds 80 characters; contains 86 characters
-----------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_c3/src/Plugin/chart/Library/C3.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
 87 | ERROR | [x] Concat operator must be surrounded by a single space
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_billboard/README.md
------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
 104 | WARNING | Line exceeds 80 characters; contains 107 characters
------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_billboard/src/Plugin/chart/Library/Billboard.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------------
 87 | ERROR | [x] Concat operator must be surrounded by a single space
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_highcharts/charts_highcharts.module
----------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------
 29 | ERROR | [x] Expected 1 space after "=>"; 2 found
 61 | ERROR | [x] Case breaking statements must be followed by a single blank line
 64 | ERROR | [x] Case breaking statements must be followed by a single blank line
 67 | ERROR | [x] Case breaking statements must be followed by a single blank line
 70 | ERROR | [x] Case breaking statements must be followed by a single blank line
 73 | ERROR | [x] Case breaking statements must be followed by a single blank line
 74 | ERROR | [x] There must be no space before the colon in a DEFAULT statement
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_highcharts/tests/src/Kernel/RawOptionsTest.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------
 19 | WARNING | [x] A comma should follow the last multiline array item. Found: 'charts_highcharts'
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_highcharts/charts_highcharts.info.yml
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_highcharts/src/Plugin/chart/Library/Highcharts.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
  17 | WARNING | [x] Unused use statement
 224 | ERROR   | [x] Expected one space after the comma, 0 found
 314 | WARNING | [ ] Only string literals should be passed to t() where possible
 359 | ERROR   | [x] Concat operator must be surrounded by a single space
 402 | ERROR   | [x] Missing function doc comment
 675 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 844 | ERROR   | [x] Missing function doc comment
 873 | ERROR   | [x] Missing function doc comment
 894 | ERROR   | [x] Missing function doc comment
-------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_google/src/Plugin/chart/Library/Google.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 120 | ERROR   | [x] Concat operator must be surrounded by a single space
 152 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 290 | WARNING | [ ] Unused variable $axis_drilldown.
 478 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 489 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_blocks/charts_blocks.info.yml
----------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
 7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
----------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_chartjs/tests/src/Kernel/RawOptionsTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
 19 | WARNING | [x] A comma should follow the last multiline array item. Found: 'charts_chartjs'
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_chartjs/tests/src/Kernel/DimensionsTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
 27 | ERROR | Parameter tags must be defined first in a doc comment
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_chartjs/README.md
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------
  44 | WARNING | Line exceeds 80 characters; contains 97 characters
 107 | WARNING | Line exceeds 80 characters; contains 95 characters
 119 | WARNING | Line exceeds 80 characters; contains 100 characters
----------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/modules/charts_chartjs/src/Plugin/chart/Library/Chartjs.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
   6 | WARNING | [x] Unused use statement
  52 | WARNING | [ ] Unused variable $yaxis_configuration.
 123 | ERROR   | [x] Concat operator must be surrounded by a single space
 364 | ERROR   | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/src/ConfigUpdater.php
-----------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------
  13 | ERROR   | [x] Missing class doc comment
  36 | ERROR   | [ ] Parameter $module_handler is not described in comment
  67 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 148 | ERROR   | [x] Missing function doc comment
 161 | ERROR   | [x] Missing function doc comment
 180 | WARNING | [ ] Unused variable $id.
 233 | ERROR   | [x] Expected newline after closing brace
 255 | ERROR   | [x] Expected newline after closing brace
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/src/Plugin/views/style/ChartsPluginStyleChart.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
 365 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/src/Element/BaseSettings.php
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------
  639 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 1435 | WARNING | [ ] Unused variable $key.
 1531 | WARNING | [ ] Unused variable $key.
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/charts/src/Element/ChartDataCollectorTable.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------------------------------
 164 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 178 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 547 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 551 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 790 | WARNING | [ ] Unused variable $row_key.
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------

Time: 1.46 secs; Memory: 20MB

Steps to reproduce

Run the command:

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /drupal/modules/contrib/charts

Proposed resolution

Resolve all the coding standard issues.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork charts-3339824

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

sahil.goyal created an issue. See original summary.

sahil.goyal’s picture

Status: Active » Needs review
StatusFileSize
new32.52 KB

Resolving all the php coding standard issues removed some unnecessary code and uploading the patch.

Status: Needs review » Needs work

The last submitted patch, 2: 3339824-2.patch, failed testing. View results

rassoni’s picture

#2 patch applied successfully .

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

elber’s picture

Status: Needs work » Needs review

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

lucienchalom’s picture

Status: Needs review » Needs work

There are still work to do, a couple of docblock are still empty.
I plan to keep working on it, but if someone can do it better, be my guest =D

lucienchalom’s picture

Status: Needs work » Needs review
Issue tags: -

added the last dockblocks, hope its all right now. =)

avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by phpcs
elber’s picture

Assigned: Unassigned » elber

I will do a review.

elber’s picture

Assigned: elber » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi congratulations!

- Module keeps working as expected
- Phpcs errors were fixed

I ran these phpcs commands

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

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

I don't see errors anymore.

andileco’s picture

Thanks, everyone, for your hard work on this issue. I would like to do some manual tests of this patch on my local instance, which has all available charts for each library. I'll aim to commit this by the end of the week.

nikathone’s picture

Status: Reviewed & tested by the community » Needs work

Changed this back to needs work. See comment above.

andileco’s picture

Status: Needs work » Needs review
StatusFileSize
new38.23 KB

A few changes from what's in MR !51 - uploading this patch to see the test results.

andileco’s picture

StatusFileSize
new38.97 KB
nayana_mvr’s picture

StatusFileSize
new28.1 KB
new10.13 KB

Verified the patch #17 on Drupal version 101.x and Charts version 5.0.x. There were 2 warning messages while applying the patch:

3339824-phpcs-17.patch:203: trailing whitespace.
      "clean-chartjs": "chmod +x scripts/clean-chartjs.sh && 
3339824-phpcs-17.patch:217: trailing whitespace.
    composer require --prefer-dist npm-asset/chart.js:^3.3 
...
warning: 2 lines add whitespace errors.

After applying the patch, there are still some more errors. Please refer the files attached.

andileco’s picture

StatusFileSize
new42.73 KB
nayana_mvr’s picture

Verified the patch #19. The patch applied cleanly and except the following errors, all other issues are fixed:

FILE: /Users/nayana.ramakrishnan/Documents/drupal10/modules/contrib/charts/modules/charts_c3/js/charts_c3.js
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
 17 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------


FILE: ../contrib/charts/modules/charts_c3/src/Plugin/chart/Library/C3.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------
 383 | ERROR | Parameter $items is not described in comment
 386 | ERROR | Doc comment for parameter $element does not match actual variable name $items
----------------------------------------------------------------------------------------------------------------------------


FILE: ../contrib/charts/modules/charts_billboard/js/charts_billboard.js
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
 17 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: ../contrib/charts/modules/charts_billboard/src/Plugin/chart/Library/Billboard.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 383 | ERROR | Parameter $items is not described in comment
 386 | ERROR | Doc comment for parameter $element does not match actual variable name $items
------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../contrib/charts/modules/charts_highcharts/js/charts_highcharts.js
----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
 25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------


FILE: ../contrib/charts/modules/charts_highcharts/src/Plugin/chart/Library/Highcharts.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
 315 | ERROR | [x] Array closing indentation error, expected 10 spaces but found 12
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: ../contrib/charts/modules/charts_google/js/charts_google.js
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 45 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: ../contrib/charts/modules/charts_google/src/Plugin/chart/Library/Google.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 290 | WARNING | Unused variable $axis_drilldown.
------------------------------------------------------------------------------------------------------------------------------------


FILE: .../contrib/charts/modules/charts_chartjs/js/charts_chartjs.js
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 40 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

Time: 2.69 secs; Memory: 24MB

Command used: Vendor/bin/phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig modules/contrib/charts

avpaderno’s picture

Category: Bug report » Task
Priority: Normal » Minor
andileco’s picture

StatusFileSize
new43.59 KB

  • andileco committed c020f7d6 on 5.0.x
    Issue #3339824 by andileco, lucienchalom, elber, sahil.goyal, nayana_mvr...
elber’s picture

Assigned: Unassigned » elber

I will do a review.

andileco’s picture

Status: Needs review » Needs work

@elber I have committed #20, which seems to address all the PHP issues without introducing any bugs that I can find after extensive manual testing. However, I would appreciate if someone can look into code style issues for JS.

elber’s picture

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

Hi I reviewed the javasScript code I follow these docs to revise

https://www.drupal.org/docs/develop/standards/javascript/javascript-best-practices
https://www.drupal.org/docs/develop/standards/javascript/javascript-coding-standards

I saw a couple javasScript files in core themes. For me files are good.

avpaderno’s picture

Issue tags: +Coding standards
elber’s picture

Status: Needs review » Reviewed & tested by the community

Hi moving to RTBC because were made a couple revisions and all it's working good.

andileco’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new4.36 KB

  • andileco committed a78ab018 on 5.0.x
    Issue #3339824 by andileco, lucienchalom, elber, sahil.goyal, nayana_mvr...

  • andileco committed 586decee on 5.0.x
    Issue #3339824 by andileco, lucienchalom, elber, sahil.goyal, nayana_mvr...

  • andileco committed 26a01834 on 5.0.x
    Issue #3339824 by andileco, lucienchalom, elber, sahil.goyal, nayana_mvr...
andileco’s picture

Status: Needs review » Fixed

Marking this fixed as phpcs passes in GitlabCI: https://git.drupalcode.org/project/charts/-/jobs/86049. Going to follow up with a different ticket for the Javascript issues identified in https://git.drupalcode.org/project/charts/-/jobs/86050

Status: Fixed » Closed (fixed)

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