Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Transaction Patterns » IDE Validation Issues
IDE Validation Issues [message #7241] Sun, 02 December 2018 04:39 Go to next message
divico is currently offline  divico
Messages: 16
Registered: August 2008
Junior Member

I am just about to finish updating my environment with the latest and greatest release levels. As usual this was a lot of fun, needed more time than anticipated and had some unpleasant side effects. It turned out that the new IDE is much more strict in validating PHP code. I am now faced with 126 errors and the ridiculous quantity of 24000 warnings. I am using Eclipse (now 4.8, previously 4.6.1) with PHP Development Tools (now 6.0, previously 4.1) and PHP 7.2 (previously 7.0). I also upgraded Radicore to 2.10. In the prior environment I had 8 errors and 300 warnings, which didn't bother me. However with the actual numbers, it is much more difficult to see my own coding issues.

Not sure if you are interested to look into these errors, some developers are keen to create projects with as few errors and warnings as possible. Focusing on the errors, these can be categorized as follows:

1.) Cannot be resolved to a type error in the "real" PHP code
The following code in audit_transfer.php is a good example of this validation error:

require 'classes/audit_hdr.class.inc';
$audit_hdr = new Audit_Hdr;
require 'classes/audit_dtl.class.inc';
$audit_dtl = new Audit_Dtl;
require 'classes/audit_dtl_jnr.class.inc';
$audit_dtl_jnr = new Audit_Dtl_jnr;

The mentioned include files are not present in my distribution. Therefore class definitions for Audit_Hdr, Audit_Dtl and Audit_Dtl_jnr could not be resolved. Running this code would obviously create a runtime exception. The IDE found similar issues in include.library.inc and tcpdf_php4.php.

2.) Cannot be resolved to a type error in the generated comment (PHPDOC)
An example is datamatrix.php where the generated comment looks as follows:
* Return the 253-state codeword
* @param $cwpad (int) Pad codeword.
* @param $cwpos (int) Number of data codewords from the beginning of encoded data.
* @return pad codeword
* @protected
For the comment "@return pad codeword" a validation error is shown, it would need to be changed to something like "@return $pad codeword" (see also here: https://www.eclipse.org/forums/index.php/t/1093196/). Most of similar validation errors are in the tcpdf library. A few ones are nusoap.php and std.fileupload2.inc.

3.) Other validation issues (These did already show up in the previous version of the IDE)
- IDE complains about the class signature in alias.class.in and default.class.inc.
- There are XML issues reported for test-request-1.xml, test-request-2.xml and test-request-3.xml

I attach a file with my findings. Line numbers are provided for the radicore 2.10 version. Validation errors are in red.

Re: IDE Validation Issues [message #7242 is a reply to message #7241] Sun, 02 December 2018 06:10 Go to previous message
AJM is currently offline  AJM
Messages: 2309
Registered: April 2006
Location: Surrey, UK
Senior Member
Issue #1 is easy to resolve. That script was only used to reformat the previous database structure into the present format, so it is now redundant and can be removed. File tcpdf_php4.php is also redundant and can be removed.

Issue #2 with datamatrix.php, qrcode.php and tcpdf_filter.php (and others) is a problem with the tcpdf library, so is out of my control.

Issue #3 can be ignored as both alias.class.inc and default.class.inc are nothing but templates used to build real class files.

Previous Topic: PopUp changes Key fields
Next Topic: Link Pattern (Additional Data of the 'Parent Field')
Goto Forum:

Current Time: Wed Sep 28 12:03:24 EDT 2022

Total time taken to generate the page: 0.01451 seconds