Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008104TestLink0 - User too Lazy to analize defined categoriespublic2017-10-10 17:572017-10-10 20:49
ReporterAppChecker 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version1.9.16 (2016 Q4) 
Fixed in Version 
Summary0008104: Possible defects in the source code
DescriptionHi.

I've checked your project with static analyzer AppChecker (https://npo-echelon.ru/en/solutions/appchecker.php [^]) and it found several possible defects. Maybe it will be useful for you.
1)
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/general/mainPage.php#L92 [^]
for($idx=0; $idx < $loop2do; $idx++)
    {
      if( $arrPlans[$idx]['id'] == $testplanID )
      {
....
         $break;
    }
 }

Probably it should be 'break;', not '$break;'
Similar: https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/general/navBar.php#L143 [^]

2)
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWithSteps.php#L185 [^]
  if( property_exists($exec, 'customfields') && !is_null($exec->customfields) )
  {
    $data["customfields"]=$customfields;
  }

Variable '$customfields' is not exists. Probably it should be:

  if( property_exists($exec, 'customfields') && !is_null($exec->customfields) )
  {
    $data["customfields"]=$exec->customfields;
  }

Similar: https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTimestamp.php#L93 [^]
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTester.php#L95 [^]
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITEForcingTimestamp.php#L174 [^]

3)
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/general/frmWorkArea.php#L162 [^]
if( intval($args->tproject_id) > 0 || intval($args->tproject_id) > 0)

$args->tproject_id is checked twice

4)
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/53d4886eed445a62edbc6a04f1ef07477951cb5f/lib/functions/print.inc.php#L164 [^]

 if ($force['displayLastEdit'] || ($req['modifier_id'] != $req['modifier_id']) )

$req['modifier_id'] is compared with itself.

Thanks.
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
(0026920)
fman (administrator)
2017-10-10 20:43

thanks a lot
(0026921)
fman (administrator)
2017-10-10 20:48
edited on: 2017-10-10 20:49

for 1 => https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/a1c2ea020e090e3d392619d1a9d3b9d0d9d11416 [^]

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/9e76e4e2669ed35459c60ad7fceeda8a4d6027eb [^]


- Issue History
Date Modified Username Field Change
2017-10-10 17:57 AppChecker New Issue
2017-10-10 20:43 fman Note Added: 0026920
2017-10-10 20:48 fman Note Added: 0026921
2017-10-10 20:49 fman Note Edited: 0026921 View Revisions



Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker