for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Modal window for repeat events purpose.
*
* @package View
* @copyright YetiForce S.A.
* @license YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com)
* @author Adrian Kon <[email protected]>
*/
* Modal window for repeat events purpose class.
class Calendar_RepeatEvents_View extends \App\Controller\Modal
{
/** {@inheritdoc} */
public $successBtnIcon = 'far fa-save';
public $modalIcon = 'fas fa-save mr-2';
protected $pageTitle = 'LBL_TITLE_TYPE_SAVING';
public $showFooter = false;
public function checkPermission(App\Request $request)
return true;
//TODO
if (!(\App\Process::hasEvent('showVisitPurpose')) && !(\App\Process::hasEvent('showSuperUserVisitPurpose'))) {
IfNode
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.
return
die
exit
function fx() { try { doSomething(); return true; } catch (\Exception $e) { return false; } return false; }
In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.
return false
throw new \App\Exceptions\NoPermitted('ERR_PERMISSION_DENIED', 406);
}
public function process(App\Request $request)
$viewer = $this->getViewer($request);
$viewer->view('Modals/RepeatEvents.tpl', $request->getModule());
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return,dieorexitstatements that have been added for debug purposes.In the above example, the last
return falsewill never be executed, because a return statement has already been met in every possible execution path.