getInstance accesses the super-global variable $_SERVER. Open
public static function getInstance(): self
{
if (!isset(self::$self)) {
\SebastianBergmann\CodeCoverage\Util\Filesystem::createDirectory(ROOT_DIRECTORY . '/tests/coverages/');
self::log(($_SERVER['REQUEST_METHOD'] ?? '') . ':' . ($_SERVER['REQUEST_URI'] ?? ''), true);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getInstance accesses the super-global variable $_SERVER. Open
public static function getInstance(): self
{
if (!isset(self::$self)) {
\SebastianBergmann\CodeCoverage\Util\Filesystem::createDirectory(ROOT_DIRECTORY . '/tests/coverages/');
self::log(($_SERVER['REQUEST_METHOD'] ?? '') . ':' . ($_SERVER['REQUEST_URI'] ?? ''), true);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getInstance accesses the super-global variable $_SERVER. Open
public static function getInstance(): self
{
if (!isset(self::$self)) {
\SebastianBergmann\CodeCoverage\Util\Filesystem::createDirectory(ROOT_DIRECTORY . '/tests/coverages/');
self::log(($_SERVER['REQUEST_METHOD'] ?? '') . ':' . ($_SERVER['REQUEST_URI'] ?? ''), true);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getInstance accesses the super-global variable $_SERVER. Open
public static function getInstance(): self
{
if (!isset(self::$self)) {
\SebastianBergmann\CodeCoverage\Util\Filesystem::createDirectory(ROOT_DIRECTORY . '/tests/coverages/');
self::log(($_SERVER['REQUEST_METHOD'] ?? '') . ':' . ($_SERVER['REQUEST_URI'] ?? ''), true);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Method getFilter
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFilter(): \SebastianBergmann\CodeCoverage\Filter
{
if (!isset($this->filter)) {
$filter = new \SebastianBergmann\CodeCoverage\Filter();
$filter->includeDirectory(ROOT_DIRECTORY . '/api');
Missing class import via use statement (line '162', column '18'). Open
$writer = new \SebastianBergmann\CodeCoverage\Report\Clover();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method log has a boolean flag argument $first, which is a certain sign of a Single Responsibility Principle violation. Open
public static function log(string $text, bool $first = false): void
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '131', column '18'). Open
$writer = new \SebastianBergmann\CodeCoverage\Report\PHP();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '70', column '18'). Open
$filter = new \SebastianBergmann\CodeCoverage\Filter();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '54', column '25'). Open
$self->driver = (new \SebastianBergmann\CodeCoverage\Driver\Selector())->forLineCoverage($filter);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '56', column '26'). Open
$self->coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage($self->driver, $filter);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\SebastianBergmann\CodeCoverage\Util\Filesystem' in method 'getInstance'. Open
\SebastianBergmann\CodeCoverage\Util\Filesystem::createDirectory(ROOT_DIRECTORY . '/tests/coverages/');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Encryption' in method 'getInstance'. Open
$self->name = date('H_i_s') . '_' . md5($_SERVER['REQUEST_URI'] ?? $_SERVER['REQUEST_TIME_FLOAT']) . '_' . \App\Encryption::generatePassword(10);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Rename "$filter" which has the same name as the field declared at line 31. Open
$filter = new \SebastianBergmann\CodeCoverage\Filter();
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Rename "$startTime" which has the same name as the field declared at line 22. Open
$startTime = microtime(true);
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Remove this commented out code. Open
// $startTime = microtime(true);
- Read upRead up
- Exclude checks
Programmers should not comment out code as it bloats programs and reduces readability.
Unused code should be deleted and can be retrieved from source control history if required.
See
- MISRA C:2004, 2.4 - Sections of code should not be "commented out".
- MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
- MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
- MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
Property \Tests\Coverage->filter
has undeclared type \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
private $filter;
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/public_html/modules/MailIntegration/');
- Exclude checks
Call to method excludeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/modules/MailIntegration/html/outlook');
- Exclude checks
Property \Tests\Coverage->coverage
has undeclared type \SebastianBergmann\CodeCoverage\CodeCoverage
Open
public $coverage;
- Exclude checks
Call to method createDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Util\Filesystem
Open
\SebastianBergmann\CodeCoverage\Util\Filesystem::createDirectory(ROOT_DIRECTORY . '/tests/coverages/');
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/config');
- Exclude checks
Call to method __construct
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter = new \SebastianBergmann\CodeCoverage\Filter();
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/app_data');
- Exclude checks
Call to method excludeFile
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeFile(ROOT_DIRECTORY . '/tests/GuiBase.php');
- Exclude checks
Call to method forLineCoverage
from undeclared class \SebastianBergmann\CodeCoverage\Driver\Selector
Open
$self->driver = (new \SebastianBergmann\CodeCoverage\Driver\Selector())->forLineCoverage($filter);
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/include');
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/install');
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/app');
- Exclude checks
Call to method excludeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/tests/setup');
- Exclude checks
Call to method generatePassword
from undeclared class \App\Encryption
(Did you mean class \Tests\App\Encryption) Open
$self->name = date('H_i_s') . '_' . md5($_SERVER['REQUEST_URI'] ?? $_SERVER['REQUEST_TIME_FLOAT']) . '_' . \App\Encryption::generatePassword(10);
- Exclude checks
Return type of getFilter()
is undeclared type \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
public function getFilter(): \SebastianBergmann\CodeCoverage\Filter
- Exclude checks
Call to method __construct
from undeclared class \SebastianBergmann\CodeCoverage\CodeCoverage
Open
$self->coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage($self->driver, $filter);
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/modules');
- Exclude checks
Call to method excludeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/tests/coverages');
- Exclude checks
Call to method excludeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/vendor');
- Exclude checks
Call to method stop
from undeclared class \SebastianBergmann\CodeCoverage\CodeCoverage
Open
$this->coverage->stop();
- Exclude checks
Reference to undeclared property \Tests\Coverage->name
Open
$self->name = date('H_i_s') . '_' . md5($_SERVER['REQUEST_URI'] ?? $_SERVER['REQUEST_TIME_FLOAT']) . '_' . \App\Encryption::generatePassword(10);
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/public_html/install');
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/vtlib/Vtiger');
- Exclude checks
Call to method includeFiles
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeFiles([
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/user_privileges');
- Exclude checks
Call to method process
from undeclared class \SebastianBergmann\CodeCoverage\Report\PHP
Open
$writer->process($this->coverage, "{$this->dir}php/{$this->name}.php");
- Exclude checks
Property \Tests\Coverage->driver
has undeclared type \SebastianBergmann\CodeCoverage\Driver
Open
public $driver;
- Exclude checks
Call to method excludeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/modules/OSSMail');
- Exclude checks
Reference to undeclared property \Tests\Coverage->name
Open
$writer->process($this->coverage, "{$this->dir}php/{$this->name}.php");
- Exclude checks
Call to method merge
from undeclared class \SebastianBergmann\CodeCoverage\CodeCoverage
Open
$this->coverage->merge(require $file);
- Exclude checks
Call to method nameAndVersion
from undeclared class \SebastianBergmann\CodeCoverage\Driver
Open
self::log('Driver: ' . $self->driver->nameAndVersion() . ' ');
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/tests');
- Exclude checks
Call to method excludeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/modules/Vtiger/pdfs');
- Exclude checks
Call to method excludeFile
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->excludeFile(ROOT_DIRECTORY . '/tests/Coverage.php');
- Exclude checks
Call to method process
from undeclared class \SebastianBergmann\CodeCoverage\Report\Clover
Open
$clover = $writer->process($this->coverage);
- Exclude checks
Call to method __construct
from undeclared class \SebastianBergmann\CodeCoverage\Driver\Selector
Open
$self->driver = (new \SebastianBergmann\CodeCoverage\Driver\Selector())->forLineCoverage($filter);
- Exclude checks
Call to method includeDirectory
from undeclared class \SebastianBergmann\CodeCoverage\Filter
(Did you mean class \vtlib\Filter) Open
$filter->includeDirectory(ROOT_DIRECTORY . '/api');
- Exclude checks
Call to method start
from undeclared class \SebastianBergmann\CodeCoverage\CodeCoverage
Open
$this->coverage->start($this->name);
- Exclude checks
Reference to undeclared property \Tests\Coverage->name
Open
$this->coverage->start($this->name);
- Exclude checks
Call to method __construct
from undeclared class \SebastianBergmann\CodeCoverage\Report\PHP
Open
$writer = new \SebastianBergmann\CodeCoverage\Report\PHP();
- Exclude checks
Call to method __construct
from undeclared class \SebastianBergmann\CodeCoverage\Report\Clover
Open
$writer = new \SebastianBergmann\CodeCoverage\Report\Clover();
- Exclude checks
Avoid variables with short names like $t. Configured minimum length is 3. Open
$t = '';
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $i. Configured minimum length is 3. Open
$i = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used to indent lines; tabs are not allowed Open
public $coverage;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::$self;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/webservice.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/tests/coverages');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log(PHP_EOL . 'Collection exception !!!' . PHP_EOL);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
rename($file, $this->dir . '' . basename($file) . '.old');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
file_put_contents("{$this->dir}coverage.xml", $clover);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/config');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/modules');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log($ex->__toString());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
file_put_contents("{$this->dir}coverage3.xml", str_replace('/var/www/html/', '/home/runner/work/YetiForceCRM/YetiForceCRM/', $clover));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Exception $ex) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $text
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $driver;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstance(): self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/tests');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/cli.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/public_html/dav.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function log(string $text, bool $first = false): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get instance and Initialize.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self->name = date('H_i_s') . '_' . md5($_SERVER['REQUEST_URI'] ?? $_SERVER['REQUEST_TIME_FLOAT']) . '_' . \App\Encryption::generatePassword(10);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter = $self->getFilter();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/public_html/index.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/modules/OSSMail');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeFile(ROOT_DIRECTORY . '/tests/Coverage.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Stop collection of code coverage information.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$writer->process($this->coverage, "{$this->dir}php/{$this->name}.php");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($coverages as $file) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$startTime = microtime(true);
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
file_put_contents("{$this->dir}coverage4.xml", str_replace('/var/www/html/', '/github/workspace/', $clover));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset(self::$self)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self->coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage($self->driver, $filter);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/include');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/dav.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/public_html/cron.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/public_html/webservice.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function start(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$writer = new \SebastianBergmann\CodeCoverage\Report\PHP();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log('Driver: ' . $self->driver->nameAndVersion() . ' ');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/modules/Vtiger/pdfs');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log('Generate report exception !!!');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var self */
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
$self->name = date('H_i_s') . '_' . md5($_SERVER['REQUEST_URI'] ?? $_SERVER['REQUEST_TIME_FLOAT']) . '_' . \App\Encryption::generatePassword(10);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get coverage filter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/app');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/public_html/file.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->filter;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $first
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$t = date('H:i:s') . ' ';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \SebastianBergmann\CodeCoverage\Filter */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\SebastianBergmann\CodeCoverage\Util\Filesystem::createDirectory(ROOT_DIRECTORY . '/tests/coverages/');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self->dir = ROOT_DIRECTORY . '/tests/coverages/';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/index.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log('Started');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->coverage->stop();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$writer = new \SebastianBergmann\CodeCoverage\Report\Clover();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
file_put_contents(ROOT_DIRECTORY . '/tests/coverages/codecoverage.log', $t . $text . '| ', FILE_APPEND);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $startTime;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self->startTime = microtime(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeFile(ROOT_DIRECTORY . '/tests/GuiBase.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->coverage->start($this->name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __destruct()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log('Stop');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// self::log('Clover Html time: ' . round(microtime(true) - $startTime, 1) . ' s.');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log($ex->__toString());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($first) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string|float */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $filter;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \SebastianBergmann\CodeCoverage\Driver */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$self = $self;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/api');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/app_data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeFiles([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/tests/setup');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$coverages = glob("{$this->dir}/php/*.php");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$clover = $writer->process($this->coverage);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Log.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log(($_SERVER['REQUEST_METHOD'] ?? '') . ':' . ($_SERVER['REQUEST_URI'] ?? ''), true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/public_html/modules/MailIntegration/');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/vtlib/Vtiger');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/file.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/vendor');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Exception $ex) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->coverage->merge(require $file);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log('Number of merged files: ' . $i);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $writer->process($this->coverage, $this->dir . 'html/');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
file_put_contents("{$this->dir}coverage4.xml", str_replace('/var/www/html/', '/github/workspace/', $clover));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log('Clover Report time: ' . round(microtime(true) - $startTime, 1) . ' s.');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \SebastianBergmann\CodeCoverage\Filter
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($this->filter)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . '/cron.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Start collection of code coverage information.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::log('Collection time: ' . round(microtime(true) - $this->startTime, 1) . ' s.' . PHP_EOL);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$i = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$t = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/user_privileges');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->excludeDirectory(ROOT_DIRECTORY . '/modules/MailIntegration/html/outlook');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $startTime = microtime(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
file_put_contents("{$this->dir}coverage3.xml", str_replace('/var/www/html/', '/home/runner/work/YetiForceCRM/YetiForceCRM/', $clover));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $dir;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $self;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/install');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Generate report.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo file_get_contents(ROOT_DIRECTORY . '/tests/coverages/codecoverage.log');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \SebastianBergmann\CodeCoverage\CodeCoverage */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self->driver = (new \SebastianBergmann\CodeCoverage\Driver\Selector())->forLineCoverage($filter);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFilter(): \SebastianBergmann\CodeCoverage\Filter
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->filter = $filter;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$i;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter = new \SebastianBergmann\CodeCoverage\Filter();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter->includeDirectory(ROOT_DIRECTORY . '/public_html/install');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function generateReport(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks