P Richards
2014-07-13 22:35:48 UTC
Hi All,
I've just finished the final pass of the work on code standards within
mantis. I personally, don't plan on doing anything more on the code base on
this for a while - (UNLESS others (well Damien!) have suggestions on things
that are not covered and they would like covered.)
I'm now going to focus on getting the code standards checking a part of the
build process for both developers locally and on travis.
Current 'build' errors on the codesniffer rules I've got are listed below.
In Mantisconnect.php, I believe we can remove the use of $QUERY_STRING as
that is legacy from php 4.
In API/Soap/mc_api.php - l_oServer as a global variable I believe is also
legacy from the nusoap days - rombert can you confirm ?
The issue with user_pref_api.php is a rule error that I'll fix.
PHP codesniffer ruleset is available on a branch under my github, if people
want to provide some feedback against the ruleset.
Alternatively, it would be good to get some feedback on any code in mantis
that now remains that people believe do not cover our existing code
standards.
Thanks for bearing with me as I've gone over the code over the last few
weeks, as it's taken about a week and a half longer than I expected to do a
final pass - as work took up a bunch of time I wasn't expecting.
If anyone has any existing pull requests, that they would rather me update
against latest master to save having to go back and re-doing the work, drop
me an email address of the existing pull request ID, and I will generate
clone your github repository and do the work for you.
Paul
----------------------------------------------
FILE: adm_config_report.php
78 | ERROR | Global Variable "t_config_types" should be prefixed $g_
FILE: api\soap\mantisconnect.php
43 | ERROR | Variable "QUERY_STRING" U is not prefixed
50 | ERROR | Variable "QUERY_STRING" U is not prefixed
50 | ERROR | Variable "QUERY_STRING" U is not prefixed
51 | ERROR | Variable "QUERY_STRING" U is not prefixed
FILE: api\soap\mc_api.php
132 | ERROR | Global Variable "l_oServer" should be prefixed $g_
FILE: core\classes\MantisEnum.class.php
116 | ERROR | Variable "_cacheAssocArrayIndexedByValues" c is not prefixed
117 | ERROR | Variable "_cacheAssocArrayIndexedByValues" c is not prefixed
144 | ERROR | Variable "_cacheAssocArrayIndexedByValues" c is not prefixed
FILE: core\columns_api.php
638 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
757 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
957 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1049 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1162 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1192 | ERROR | Global Variable "t_sort" should be prefixed $g_
1470 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1518 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
FILE: core\custom_function_api.php
312 | ERROR | Global Variable "t_sort" should be prefixed $g_
FILE: core\install_helper_functions_api.php
95 | ERROR | Global Variable "f_db_type" should be prefixed $g_
FILE: core\user_pref_api.php
259 | ERROR | Variable "_default_mapping" d is not prefixed
261 | ERROR | Variable "_default_mapping" d is not prefixed
276 | ERROR | Variable "_default_mapping" d is not prefixed
I've just finished the final pass of the work on code standards within
mantis. I personally, don't plan on doing anything more on the code base on
this for a while - (UNLESS others (well Damien!) have suggestions on things
that are not covered and they would like covered.)
I'm now going to focus on getting the code standards checking a part of the
build process for both developers locally and on travis.
Current 'build' errors on the codesniffer rules I've got are listed below.
In Mantisconnect.php, I believe we can remove the use of $QUERY_STRING as
that is legacy from php 4.
In API/Soap/mc_api.php - l_oServer as a global variable I believe is also
legacy from the nusoap days - rombert can you confirm ?
The issue with user_pref_api.php is a rule error that I'll fix.
PHP codesniffer ruleset is available on a branch under my github, if people
want to provide some feedback against the ruleset.
Alternatively, it would be good to get some feedback on any code in mantis
that now remains that people believe do not cover our existing code
standards.
Thanks for bearing with me as I've gone over the code over the last few
weeks, as it's taken about a week and a half longer than I expected to do a
final pass - as work took up a bunch of time I wasn't expecting.
If anyone has any existing pull requests, that they would rather me update
against latest master to save having to go back and re-doing the work, drop
me an email address of the existing pull request ID, and I will generate
clone your github repository and do the work for you.
Paul
----------------------------------------------
FILE: adm_config_report.php
78 | ERROR | Global Variable "t_config_types" should be prefixed $g_
FILE: api\soap\mantisconnect.php
43 | ERROR | Variable "QUERY_STRING" U is not prefixed
50 | ERROR | Variable "QUERY_STRING" U is not prefixed
50 | ERROR | Variable "QUERY_STRING" U is not prefixed
51 | ERROR | Variable "QUERY_STRING" U is not prefixed
FILE: api\soap\mc_api.php
132 | ERROR | Global Variable "l_oServer" should be prefixed $g_
FILE: core\classes\MantisEnum.class.php
116 | ERROR | Variable "_cacheAssocArrayIndexedByValues" c is not prefixed
117 | ERROR | Variable "_cacheAssocArrayIndexedByValues" c is not prefixed
144 | ERROR | Variable "_cacheAssocArrayIndexedByValues" c is not prefixed
FILE: core\columns_api.php
638 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
757 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
957 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1049 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1162 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1192 | ERROR | Global Variable "t_sort" should be prefixed $g_
1470 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
1518 | ERROR | Global Variable "t_icon_path" should be prefixed $g_
FILE: core\custom_function_api.php
312 | ERROR | Global Variable "t_sort" should be prefixed $g_
FILE: core\install_helper_functions_api.php
95 | ERROR | Global Variable "f_db_type" should be prefixed $g_
FILE: core\user_pref_api.php
259 | ERROR | Variable "_default_mapping" d is not prefixed
261 | ERROR | Variable "_default_mapping" d is not prefixed
276 | ERROR | Variable "_default_mapping" d is not prefixed