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
Comments
Comment #2
sahil.goyal commentedResolving all the php coding standard issues removed some unnecessary code and uploading the patch.
Comment #4
rassoni commented#2 patch applied successfully .
Comment #7
elberComment #9
lucienchalom commentedThere 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
Comment #10
lucienchalom commentedadded the last dockblocks, hope its all right now. =)
Comment #11
avpadernoComment #12
elberI will do a review.
Comment #13
elberHi congratulations!
- Module keeps working as expected
- Phpcs errors were fixed
I ran these phpcs commands
I don't see errors anymore.
Comment #14
andileco commentedThanks, 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.
Comment #15
nikathoneChanged this back to needs work. See comment above.
Comment #16
andileco commentedA few changes from what's in MR !51 - uploading this patch to see the test results.
Comment #17
andileco commentedComment #18
nayana_mvr commentedVerified the patch #17 on Drupal version 101.x and Charts version 5.0.x. There were 2 warning messages while applying the patch:
After applying the patch, there are still some more errors. Please refer the files attached.
Comment #19
andileco commentedComment #20
nayana_mvr commentedVerified the patch #19. The patch applied cleanly and except the following errors, all other issues are fixed:
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/chartsComment #21
avpadernoComment #22
andileco commentedComment #24
elberI will do a review.
Comment #25
andileco commented@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.
Comment #26
elberHi I reviewed the javasScript code I follow these docs to revise
I saw a couple javasScript files in core themes. For me files are good.
Comment #27
avpadernoComment #28
elberHi moving to RTBC because were made a couple revisions and all it's working good.
Comment #29
andileco commentedComment #33
andileco commentedMarking 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