File PackageExport.php
has 624 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* +**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
Function exportRelatedLists
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function exportRelatedLists(ModuleBasic $moduleInstance)
{
if (!$moduleInstance->isentitytype) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function exportFields
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function exportFields(ModuleBasic $moduleInstance, $blockid)
{
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
if (0 === $dataReader->count()) {
return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method exportFields
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exportFields(ModuleBasic $moduleInstance, $blockid)
{
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
if (0 === $dataReader->count()) {
return;
The class PackageExport has 23 public methods. Consider refactoring PackageExport to keep number of public methods under 10. Open
class PackageExport
{
public $_export_tmpdir = 'cache/vtlib';
public $_export_modulexml_filename;
public $_export_modulexml_file;
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class PackageExport has an overall complexity of 119 which is very high. The configured complexity threshold is 50. Open
class PackageExport
{
public $_export_tmpdir = 'cache/vtlib';
public $_export_modulexml_filename;
public $_export_modulexml_file;
- Exclude checks
Method export
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
{
$this->zipFileName = $zipFileName;
$this->moduleInstance = $moduleInstance;
$module = $this->moduleInstance->name;
Function export
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
{
$this->zipFileName = $zipFileName;
$this->moduleInstance = $moduleInstance;
$module = $this->moduleInstance->name;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method exportRelatedLists
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exportRelatedLists(ModuleBasic $moduleInstance)
{
if (!$moduleInstance->isentitytype) {
return;
}
PackageExport
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class PackageExport
{
public $_export_tmpdir = 'cache/vtlib';
public $_export_modulexml_filename;
public $_export_modulexml_file;
Method exportCustomViews
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exportCustomViews(ModuleBasic $moduleInstance)
{
$customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
->createCommand()->query();
if (!$customViewDataReader->count()) {
Method exportModule
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exportModule()
{
$moduleId = $this->moduleInstance->id;
$row = (new \App\Db\Query())
->select(['name', 'tablabel', 'version', 'type', 'premium'])
Function exportSharingAccess
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function exportSharingAccess(ModuleBasic $moduleInstance)
{
$permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
if (empty($permission)) {
return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method exportSharingAccess
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exportSharingAccess(ModuleBasic $moduleInstance)
{
$permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
if (empty($permission)) {
return;
Function exportCustomViews
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function exportCustomViews(ModuleBasic $moduleInstance)
{
$customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
->createCommand()->query();
if (!$customViewDataReader->count()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function exportDependencies
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function exportDependencies(ModuleBasic $moduleInstance)
{
$moduleId = $moduleInstance->id;
$minVersion = \App\Version::get();
$maxVersion = false;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method export() has 100 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
{
$this->zipFileName = $zipFileName;
$this->moduleInstance = $moduleInstance;
$module = $this->moduleInstance->name;
- Exclude checks
The method export() has an NPath complexity of 18432. The configured NPath complexity threshold is 200. Open
public function export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
{
$this->zipFileName = $zipFileName;
$this->moduleInstance = $moduleInstance;
$module = $this->moduleInstance->name;
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method exportFields() has an NPath complexity of 3586. The configured NPath complexity threshold is 200. Open
public function exportFields(ModuleBasic $moduleInstance, $blockid)
{
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
if (0 === $dataReader->count()) {
return;
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method exportFields() has 109 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function exportFields(ModuleBasic $moduleInstance, $blockid)
{
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
if (0 === $dataReader->count()) {
return;
- Exclude checks
The method exportRelatedLists() has an NPath complexity of 242. The configured NPath complexity threshold is 200. Open
public function exportRelatedLists(ModuleBasic $moduleInstance)
{
if (!$moduleInstance->isentitytype) {
return;
}
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method export() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10. Open
public function export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
{
$this->zipFileName = $zipFileName;
$this->moduleInstance = $moduleInstance;
$module = $this->moduleInstance->name;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method exportFields() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10. Open
public function exportFields(ModuleBasic $moduleInstance, $blockid)
{
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
if (0 === $dataReader->count()) {
return;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method exportRelatedLists() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
public function exportRelatedLists(ModuleBasic $moduleInstance)
{
if (!$moduleInstance->isentitytype) {
return;
}
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Class "PackageExport" has 24 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class PackageExport
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
Refactor this function to reduce its Cognitive Complexity from 35 to the 15 allowed. Open
public function exportRelatedLists(ModuleBasic $moduleInstance)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed. Open
public function export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 34 to the 15 allowed. Open
public function exportFields(ModuleBasic $moduleInstance, $blockid)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
The class PackageExport has a coupling between objects value of 21. Consider to reduce the number of dependencies under 13. Open
class PackageExport
{
public $_export_tmpdir = 'cache/vtlib';
public $_export_modulexml_filename;
public $_export_modulexml_file;
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Missing class import via use statement (line '781', column '22'). Open
$dataReader = (new \App\Db\Query())->from(\Vtiger_Inventory_Model::getInstance($this->moduleInstance->name)->getTableName())->createCommand()->query();
- 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 '627', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['actionname'])->from('vtiger_profile2utility')->innerJoin('vtiger_actionmapping', 'vtiger_profile2utility.activityid = vtiger_actionmapping.actionid')->where(['tabid' => $moduleInstance->id])->distinct('actionname')->createCommand()->query();
- 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 '652', column '22'). Open
$dataReader = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['tabid' => $moduleId])->createCommand()->query();
- 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 '423', column '22'). Open
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
- 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 closeNode has a boolean flag argument $space, which is a certain sign of a Single Responsibility Principle violation. Open
public function closeNode($node, $delimiter = PHP_EOL, $space = true)
- 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 '480', column '28'). Open
$fieldRelModule = (new \App\Db\Query())->select(['relmodule'])->from('vtiger_fieldmodulerel')->where(['fieldid' => $row['fieldid']])->column();
- 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 '249', column '47'). Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator('languages', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- 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 '268', column '22'). Open
$dataReader = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $moduleId])->createCommand()->query();
- 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 '508', column '28'). Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_trees_templates_data')->where(['templateid' => $fieldParams])->createCommand()->query();
- 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 '559', column '31'). Open
$cvColumnDataReader = (new \App\Db\Query())->from('vtiger_cvcolumnlist')->where(['cvid' => $cvid])->createCommand()->query();
- 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 '690', column '25'). Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['related_tabid' => $moduleId])->createCommand()->query();
- 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 '391', column '22'). Open
$dataReader = (new \App\Db\Query())->from('vtiger_blocks')->where(['tabid' => $moduleInstance->id])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- 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 '295', column '15'). Open
$row = (new \App\Db\Query())
- 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 '155', column '14'). Open
throw new \App\Exceptions\AppException('File already exists: ' . $this->zipFileName);
- 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 '427', column '23'). Open
$entityField = (new \App\Db\Query())->select(['fieldname', 'entityidfield', 'entityidcolumn'])->from('vtiger_entityname')->where(['tabid' => $moduleInstance->id])->one();
- 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 '538', column '32'). Open
$customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
- 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 export has a boolean flag argument $directDownload, which is a certain sign of a Single Responsibility Principle violation. Open
public function export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
- 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 '249', column '16'). Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator('languages', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- 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 '504', column '24'). Open
$treesExist = (new \App\Db\Query())->select(['name', 'access'])->from('vtiger_trees_templates')->where(['templateid' => $fieldParams])->one();
- 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 '588', column '22'). Open
$permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
- 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 '\Vtiger_Viewer' in method 'export'. Open
if (is_dir('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}")) {
- 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 '\Vtiger_Viewer' in method 'export'. Open
if (file_exists('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png")) {
- 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
The method exportModule uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$type = 'entity';
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Vtiger_Viewer' in method 'export'. Open
$zip->addFile('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png", "$module.png");
- 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 assigning values to variables in if clauses and the like (line '714', column '9'). Open
public function exportRelatedLists(ModuleBasic $moduleInstance)
{
if (!$moduleInstance->isentitytype) {
return;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Zip' in method 'export'. Open
$zip = \App\Zip::createFile($this->zipFileName);
- 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 'vtlib\Utils' in method '__initExport'. Open
Utils::checkFileAccessForInclusion("modules/$module/$module.php");
- 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
The method export uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$zip->close();
if ($todir) {
copy($this->zipFileName, $todir);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '370', column '19'). Open
public function exportTables()
{
$modulename = $this->moduleInstance->name;
$this->openNode('tables');
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Field' in method 'exportRelatedLists'. Open
if ($fields = \App\Field::getFieldsFromRelation($row['relation_id'])) {
- 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 '\Vtiger_Viewer' in method 'export'. Open
'layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}",
- 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 '\Vtiger_Viewer' in method 'export'. Open
'public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}/resources",
- 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 '\CRMEntity' in method 'exportTables'. Open
$focus = \CRMEntity::getInstance($modulename);
- 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 'vtlib\Cron' in method 'exportCronTasks'. Open
$cronTasks = Cron::listAllInstancesByModule($moduleInstance->name);
- 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 '\Vtiger_Viewer' in method 'export'. Open
if ($layoutName != 'layouts/' . \Vtiger_Viewer::getDefaultLayoutName()) {
- 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 assigning values to variables in if clauses and the like (line '676', column '9'). Open
public function exportRelatedLists(ModuleBasic $moduleInstance)
{
if (!$moduleInstance->isentitytype) {
return;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\Vtiger_Viewer' in method 'export'. Open
if (is_dir('public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}/resources")) {
- 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\Version' in method 'exportDependencies'. Open
$minVersion = \App\Version::get();
- 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\Purifier' in method 'exportTables'. Open
$this->outputNode('<![CDATA[' . \App\Purifier::decodeHtml($createTable['Create Table']) . ']]>', 'sql');
- 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 '\Vtiger_Viewer' in method 'export'. Open
if (is_dir('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}")) {
- 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\Fields\RecordNumber' in method 'exportFields'. Open
$valueFieldNumber = \App\Fields\RecordNumber::getInstance($moduleInstance->id);
- 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 '\Vtiger_Viewer' in method 'export'. Open
if (is_dir('public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}/resources")) {
- 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\CustomView' in method 'exportCustomViews'. Open
$rules = \App\CustomView::getConditions($cvid);
- 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\Field' in method 'exportRelatedLists'. Open
if ($fields = \App\Field::getFieldsFromRelation($row['relation_id'])) {
- 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 '\Vtiger_Viewer' in method 'export'. Open
'layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}",
- 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 '\Vtiger_Viewer' in method 'export'. Open
'public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}/resources",
- 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 '\VtlibUtils' in method 'exportTables'. Open
\VtlibUtils::vtlibSetupModulevars($modulename, $focus);
- 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\Fields\Picklist' in method 'exportFields'. Open
foreach (\App\Fields\Picklist::getValuesName($fieldname) as $picklistvalue) {
- 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\Json' in method 'exportCustomViews'. Open
$this->outputNode('<![CDATA[' . \App\Json::encode($rules) . ']]>', 'rules');
- 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
Define a constant instead of duplicating this literal "actions" 8 times. Open
$this->openNode('actions');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "fields" 10 times. Open
$this->openNode('fields');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "entityidfield" 3 times. Open
$entityField = (new \App\Db\Query())->select(['fieldname', 'entityidfield', 'entityidcolumn'])->from('vtiger_entityname')->where(['tabid' => $moduleInstance->id])->one();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "displaytype" 4 times. Open
$this->outputNode($row['displaytype'], 'displaytype');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "summaryfield" 3 times. Open
if (isset($row['summaryfield'])) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "fieldparams" 4 times. Open
$fieldParams = $row['fieldparams'];
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "presence" 10 times. Open
$this->outputNode($row['presence'], 'presence');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "access" 3 times. Open
$treesExist = (new \App\Db\Query())->select(['name', 'access'])->from('vtiger_trees_templates')->where(['templateid' => $fieldParams])->one();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "relation_comment" 4 times. Open
$this->outputNode($row['relation_comment'], 'relation_comment');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "sequence" 15 times. Open
$dataReader = (new \App\Db\Query())->from('vtiger_blocks')->where(['tabid' => $moduleInstance->id])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "description" 3 times. Open
$this->outputNode('<![CDATA[' . $row['description'] . ']]>', 'description');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "field_name" 5 times. Open
$this->outputNode($cvRow['field_name'], 'fieldname');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "columnname" 4 times. Open
$columnName = $row['columnname'];
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "label" 9 times. Open
$this->outputNode($row['tablabel'], 'label');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "action" 4 times. Open
$this->openNode('action');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "block" 5 times. Open
$this->openNode('block');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "field" 8 times. Open
$this->openNode('field');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "entityidcolumn" 3 times. Open
$entityField = (new \App\Db\Query())->select(['fieldname', 'entityidfield', 'entityidcolumn'])->from('vtiger_entityname')->where(['tabid' => $moduleInstance->id])->one();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "defaultvalue" 4 times. Open
$this->outputNode($row['defaultvalue'], 'defaultvalue');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "view_type" 4 times. Open
$this->outputNode($row['view_type'], 'view_type');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "<![CDATA[" 4 times. Open
$this->outputNode('<![CDATA[' . \App\Purifier::decodeHtml($createTable['Create Table']) . ']]>', 'sql');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "inventory" 3 times. Open
$type = 'inventory';
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "favorites" 4 times. Open
$this->outputNode($row['favorites'], 'favorites');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "fieldname" 5 times. Open
$entityField = (new \App\Db\Query())->select(['fieldname', 'entityidfield', 'entityidcolumn'])->from('vtiger_entityname')->where(['tabid' => $moduleInstance->id])->one();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "layouts/" 7 times. Open
if (is_dir('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}")) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "tabid" 9 times. Open
$dataReader = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $moduleId])->createCommand()->query();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "version" 3 times. Open
->select(['name', 'tablabel', 'version', 'type', 'premium'])
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "premium" 3 times. Open
->select(['name', 'tablabel', 'version', 'type', 'premium'])
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "public_html/layouts/" 4 times. Open
if (is_dir('public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}/resources")) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "actionname" 3 times. Open
$dataReader = (new \App\Db\Query())->select(['actionname'])->from('vtiger_profile2utility')->innerJoin('vtiger_actionmapping', 'vtiger_profile2utility.activityid = vtiger_actionmapping.actionid')->where(['tabid' => $moduleInstance->id])->distinct('actionname')->createCommand()->query();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "masseditable" 3 times. Open
if (isset($row['masseditable'])) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "creator_detail" 4 times. Open
$this->outputNode($row['creator_detail'], 'creator_detail');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Reference to undeclared property \CRMEntity->tab_name
Open
$tables = $focus->tab_name;
- Exclude checks
Call to undeclared method \vtlib\PackageExport::getName
Open
$this->outputNode($cronTask->getName(), 'name');
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_trees_templates_data')->where(['templateid' => $fieldParams])->createCommand()->query();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
- Exclude checks
Call to undeclared method \vtlib\PackageExport::getDescription
Open
$this->outputNode($cronTask->getDescription(), 'description');
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new \App\Db\Query())->from('vtiger_blocks')->where(['tabid' => $moduleInstance->id])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
$dataReader = (new \App\Db\Query())->from(\Vtiger_Inventory_Model::getInstance($this->moduleInstance->name)->getTableName())->createCommand()->query();
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
$module = $this->moduleInstance->name;
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
$moduleId = $this->moduleInstance->id;
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$row = (new \App\Db\Query())
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportSharingAccess()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:586
Open
$this->exportSharingAccess($this->moduleInstance);
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
if ($this->moduleInstance->isentitytype) {
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['related_tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Call to undeclared method \vtlib\PackageExport::getHandlerClass
Open
$this->outputNode($cronTask->getHandlerClass(), 'handler');
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
if ($this->moduleInstance->isentitytype) {
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
$this->zipFileName = $this->moduleInstance->name . '_' . date('Y-m-d-Hi') . '_' . $this->moduleInstance->version . '.zip';
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$fieldRelModule = (new \App\Db\Query())->select(['relmodule'])->from('vtiger_fieldmodulerel')->where(['fieldid' => $row['fieldid']])->column();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$entityField = (new \App\Db\Query())->select(['fieldname', 'entityidfield', 'entityidcolumn'])->from('vtiger_entityname')->where(['tabid' => $moduleInstance->id])->one();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$createTable = \App\Db::getInstance()->createCommand('SHOW CREATE TABLE ' . $table)->queryOne();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$treesExist = (new \App\Db\Query())->select(['name', 'access'])->from('vtiger_trees_templates')->where(['templateid' => $fieldParams])->one();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['actionname'])->from('vtiger_profile2utility')->innerJoin('vtiger_actionmapping', 'vtiger_profile2utility.activityid = vtiger_actionmapping.actionid')->where(['tabid' => $moduleInstance->id])->distinct('actionname')->createCommand()->query();
- Exclude checks
Argument 1 (moduleName)
is false
but \vtlib\Cron::listAllInstancesByModule()
takes string
defined at /code/vtlib/Vtiger/Cron.php:495
Open
$cronTasks = Cron::listAllInstancesByModule($moduleInstance->name);
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportCronTasks()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:759
Open
$this->exportCronTasks($this->moduleInstance);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportActions()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:622
Open
$this->exportActions($this->moduleInstance);
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportCustomLinks()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:733
Open
$this->exportCustomLinks($this->moduleInstance);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
if (!$this->moduleInstance->isentitytype) {
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportRelatedLists()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:646
Open
$this->exportRelatedLists($this->moduleInstance);
- Exclude checks
Assigning null
to property but \vtlib\PackageExport->_export_modulexml_file
is false|resource
Open
$this->_export_modulexml_file = null;
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportBlocks()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:389
Open
$this->exportBlocks($this->moduleInstance);
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type false
Open
$modulename = $this->moduleInstance->name;
- Exclude checks
Call to undeclared method \vtlib\PackageExport::getSequence
Open
$this->outputNode($cronTask->getSequence(), 'sequence');
- Exclude checks
Assigning \vtlib\Module
to property but \vtlib\PackageExport->moduleInstance
is false
Open
$this->moduleInstance = $moduleInstance;
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportDependencies()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:263
Open
$this->exportDependencies($this->moduleInstance);
- Exclude checks
Argument 1 (moduleInstance)
is false
but \vtlib\PackageExport::exportCustomViews()
takes \vtlib\ModuleBasic
defined at /code/vtlib/Vtiger/PackageExport.php:536
Open
$this->exportCustomViews($this->moduleInstance);
- Exclude checks
Call to undeclared method \App\Db::getTableSchema
Open
$infoSchema = \App\Db::getInstance()->getTableSchema($tableName);
- Exclude checks
Call to method getInstance
from undeclared class \App\Fields\RecordNumber
(Did you mean class \Tests\Base\RecordNumber) Open
$valueFieldNumber = \App\Fields\RecordNumber::getInstance($moduleInstance->id);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$cvColumnDataReader = (new \App\Db\Query())->from('vtiger_cvcolumnlist')->where(['cvid' => $cvid])->createCommand()->query();
- Exclude checks
Call to undeclared method \vtlib\PackageExport::getFrequency
Open
$this->outputNode($cronTask->getFrequency(), 'frequency');
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new \App\Db\Query())->from(\Vtiger_Inventory_Model::getInstance($this->moduleInstance->name)->getTableName())->createCommand()->query();
- Exclude checks
Call to undeclared method \vtlib\PackageExport::getStatus
Open
$this->outputNode($cronTask->getStatus(), 'status');
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($dataReader->count()) {
$this->openNode('relatedlists');
while ($row = $dataReader->read()) {
$this->openNode('relatedlist');
$this->outputNode(Module::getInstance($row['related_tabid'])->name, 'relatedmodule');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 359.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($dataReaderRow->count()) {
$this->openNode('inrelatedlists');
while ($row = $dataReaderRow->read()) {
$this->openNode('inrelatedlist');
$this->outputNode(Module::getInstance($row['tabid'])->name, 'inrelatedmodule');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 359.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long variable names like $_export_modulexml_filename. Keep variable name length under 20. Open
public $_export_modulexml_filename;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $_export_modulexml_file. Keep variable name length under 20. Open
public $_export_modulexml_file;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
The property $_export_tmpdir is not named in camelCase. Open
class PackageExport
{
public $_export_tmpdir = 'cache/vtlib';
public $_export_modulexml_filename;
public $_export_modulexml_file;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_export_modulexml_filename is not named in camelCase. Open
class PackageExport
{
public $_export_tmpdir = 'cache/vtlib';
public $_export_modulexml_filename;
public $_export_modulexml_file;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_export_modulexml_file is not named in camelCase. Open
class PackageExport
{
public $_export_tmpdir = 'cache/vtlib';
public $_export_modulexml_filename;
public $_export_modulexml_file;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Property name "$_export_modulexml_filename" should not be prefixed with an underscore to indicate visibility Open
public $_export_modulexml_filename;
- Exclude checks
Property name "$_export_modulexml_file" should not be prefixed with an underscore to indicate visibility Open
public $_export_modulexml_file;
- Exclude checks
Property name "$_export_tmpdir" should not be prefixed with an underscore to indicate visibility Open
public $_export_tmpdir = 'cache/vtlib';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pre = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pre = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pre = str_repeat("\t", $this->openNode);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('' != $node) {
- 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
fwrite($this->_export_modulexml_file, $value ?? '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __getManifestFilePath()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->_export_modulexml_filename)) {
- 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 (false === is_dir($this->_export_tmpdir)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** Output Handlers */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function closeNode($node, $delimiter = PHP_EOL, $space = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__write($pre . "</$node>$delimiter");
- 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->_export_modulexml_file = fopen($this->__getManifestFilePath(), 'w');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __construct()
- 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 $_export_tmpdir = 'cache/vtlib';
- 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->closeNode($node, PHP_EOL, false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Post export work.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
mkdir($this->_export_tmpdir, 0755);
- 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 $_export_modulexml_file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Constructor.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function outputNode($value, $node = '')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__write($value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __write($value)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return "$this->_export_tmpdir/$this->_export_modulexml_filename";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $module
- 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
Utils::checkFileAccessForInclusion("modules/$module/$module.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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pre = str_repeat("\t", $this->openNode);
- 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
* Initialize Export.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// We will be including the file, so do a security check.
- 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
protected $moduleInstance = false;
- 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
if ('' === $delimiter || PHP_EOL === $delimiter) {
- 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
// Set the module xml filename to be written for exporting.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->moduleInstance->isentitytype) {
- 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
// Call module export function
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->zipFileName = $this->moduleInstance->name . '_' . date('Y-m-d-Hi') . '_' . $this->moduleInstance->version . '.zip';
- 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
// Copy config files
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->download($module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Zip $zip
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addFile($filePath, $zipPath);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set the module.xml file path for this export and
- 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 __initExport($module)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $_export_modulexml_filename;
- 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
$this->openNode($node, '');
- 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
public function __finishExport()
- 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
--$this->openNode;
- 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
unlink($this->__getManifestFilePath());
- 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
$zip->addDirectory(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
true
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
true
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($layoutName != 'layouts/' . \Vtiger_Viewer::getDefaultLayoutName()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($directDownload) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($todir) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__cleanupExport();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zipPath = str_replace(\DIRECTORY_SEPARATOR, '/', $item->getPath() . \DIRECTORY_SEPARATOR . $item->getFilename());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $zipFileName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($space) {
- 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 its temporary path.
- 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->_export_modulexml_filename = 'manifest-' . time() . '.xml';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__write("<?xml version='1.0'?>\n");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($this->_export_modulexml_file)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->zipFileName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $todir Output directory path
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__initExport($module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists($this->zipFileName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addDirectory("modules/$module");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'templates',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'settings/public_resources',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
copy($this->zipFileName, $todir);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $openNode = 0;
- 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 openNode($node, $delimiter = PHP_EOL)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__write($pre . "<$node>$delimiter");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$this->openNode;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('' != $node) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Clean up the temporary files created.
- 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
throw new \App\Exceptions\AppException('File already exists: ' . $this->zipFileName);
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
if (is_dir('public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}/resources")) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($layoutDirectories as $layoutName) {
- 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
$moduleId = $this->moduleInstance->id;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['tablabel'], 'label');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($tabVersion, 'version');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportCronTasks($this->moduleInstance);
- 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
* Export module blocks with its related fields.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === $dataReader->count()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->_export_modulexml_file = null;
- 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
// Copy module directory
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}")) {
- 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
//Copy module public Settings resources files
- 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->__copyLanguageFiles($zip, $module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addFile('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png", "$module.png");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('vtiger_min_version' == $prefName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('vtiger_max_version' == $prefName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export Module Handler.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tabVersion = $row['version'] ?? false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('module');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = 'inventory';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export module tables
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('module');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportFields($moduleInstance, $row['blockid']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
fclose($this->_export_modulexml_file);
- 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 export(Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addFile($this->__getManifestFilePath(), 'manifest.xml');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'settings/modules',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir("cron/modules/{$module}")) {
- 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
if (is_dir('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}")) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir('public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}/resources")) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir($settingsLayout)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Copy image file
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$zipPath = str_replace(\DIRECTORY_SEPARATOR, '/', $item->getPath() . \DIRECTORY_SEPARATOR . $item->getFilename());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export vtiger dependencies.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($maxVersion, 'vtiger_max_version');
- 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->exportTables();
- 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 __cleanupExport()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $zipFileName Zipfilename to use
- 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 $directDownload True for sending the output as download
- 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->exportModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
'public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}/resources",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__finishExport();
- 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 (empty($this->zipFileName)) {
- 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
// Copy Settings/module directory
- 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
$zip->addDirectory(
- 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
//Copy Settings module templates files, if any
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'settings/templates',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$prefName = $row['prefname'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Copy module public resources files
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxVersion = $prefValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir('public_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}/resources")) {
- 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_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}/resources",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportModule()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addDirectory($moduleLayout, $moduleLayout);
- 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
//Export cronTasks
- 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->openNode('tables');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('dependencies');
- 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
$this->outputNode($row['create_view'], 'create_view');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export dependency information
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export fields related to a module block.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export Sharing Access
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportRelatedLists($this->moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $blockid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportCustomLinks($this->moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$createTable = \App\Db::getInstance()->createCommand('SHOW CREATE TABLE ' . $table)->queryOne();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('table');
- 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 (!empty($this->_export_modulexml_filename)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->zipFileName = $this->_export_tmpdir . '/' . $this->zipFileName;
- 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
$zip->addDirectory(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
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
$moduleLayout = $layoutName . "/modules/$module";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator('languages', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- Exclude checks
Line exceeds 120 characters; contains 185 characters Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator('languages', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['premium'], 'premium');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export Related Lists
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->from('vtiger_blocks')->where(['tabid' => $moduleInstance->id])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- 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
public function getZipFileName()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->zipFileName = $zipFileName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip = \App\Zip::createFile($this->zipFileName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Add manifest file
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addDirectory("cron/modules/{$module}", 'cron', 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
}
- 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
$minVersion = $prefValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (1 == $tabType) {
- 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
$focus = \CRMEntity::getInstance($modulename);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tables = $focus->tab_name;
- 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->openNode('blocks');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['blocklabel'], 'blocklabel');
- 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
$module = $this->moduleInstance->name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules/Settings/{$module}",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
true
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}",
- 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_html/layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/{$module}/resources",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addDirectory(
- 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
//Copy language files
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$zip->addFile('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png", "$module.png");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_tab')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export module blocks
- 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
if (!$this->moduleInstance->isentitytype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export Custom Links
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== ($key = array_search('vtiger_crmentity', $tables))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = 'entity';
- 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
// Export module filters
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportBlocks(ModuleBasic $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export module inventory fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportInventory();
- 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
$modulename = $this->moduleInstance->name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$dataReader = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tabType = $row['type'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportActions($this->moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export module base and related tables.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($tables[$key]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($tables as $table) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($table, 'name');
- 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->outputNode($row['show_title'], 'show_title');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('block');
- 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->moduleInstance = $moduleInstance;
- 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_resources',
- 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
//Support to multiple layouts of module
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addDirectory($settingsLayout, $settingsLayout);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxVersion = false;
- 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->outputNode(date('Y-m-d H:i:s'), 'exporttime');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportBlocks($this->moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportCustomViews($this->moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['visible'], 'visible');
- 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 exportFields(ModuleBasic $moduleInstance, $blockid)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportDependencies(ModuleBasic $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleId = $moduleInstance->id;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$prefValue = $row['prefvalue'];
- 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
->where(['tabid' => $moduleId])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = 'extension';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportDependencies($this->moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportTables()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->moduleInstance->isentitytype) {
- 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 ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['display_status'], 'display_status');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = $row['fieldparams'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($row['summaryfield'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export field to module relations
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('relatedmodules');
- 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
$dataReaderRow->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportCustomViews(ModuleBasic $moduleInstance)
- 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->openNode('entityidentifier');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('entityidentifier');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$treesExist = (new \App\Db\Query())->select(['name', 'access'])->from('vtiger_trees_templates')->where(['templateid' => $fieldParams])->one();
- 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->closeNode('field');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$setdefault = (1 == $row['setdefault']) ? 'true' : 'false';
- 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
//Copy module templates files
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists("config/Modules/$module.php")) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __copyLanguageFiles(\App\Zip $zip, $module)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($item->isFile() && $item->getFilename() === $module . '.json') {
- 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->outputNode($minVersion, 'vtiger_version');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['name'], 'name');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($type, 'type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (1 == $tabType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Setup required module variables which is need for vtlib API's
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('table');
- 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->outputNode($row['edit_view'], 'edit_view');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['displaytype'], 'displaytype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir($moduleLayout)) {
- 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 ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$minVersion = \App\Version::get();
- 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
->select(['name', 'tablabel', 'version', 'type', 'premium'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['iscustom'], 'iscustom');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- 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
// Copy cron files of the module (if any)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$layoutDirectories = glob('layouts' . '/*', GLOB_ONLYDIR);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$settingsLayout = $layoutName . "/modules/Settings/$module";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists('layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png")) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function copies language files to zip.
- 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 $module
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $maxVersion) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\VtlibUtils::vtlibSetupModulevars($modulename, $focus);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 169 characters Open
$dataReader = (new \App\Db\Query())->from('vtiger_blocks')->where(['tabid' => $moduleInstance->id])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- 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->outputNode($row['detail_view'], 'detail_view');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export fields associated with the block
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('blocks');
- 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
if (0 === $dataReader->count()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get last name of zip file.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export Module as a zip file.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \vtlib\Module $moduleInstance Instance of module
- 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
// Export as Zip
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$this->zipFileName = $this->moduleInstance->name . '_' . date('Y-m-d-Hi') . '_' . $this->moduleInstance->version . '.zip';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir("modules/Settings/$module")) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addDirectory(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
true
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/modules/Settings/{$module}",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$zip->addFile("config/Modules/$module.php", "config/$module.php");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath = $item->getRealPath();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('dependencies');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($tabVersion) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exportSharingAccess($this->moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export Actions
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode('<![CDATA[' . \App\Purifier::decodeHtml($createTable['Create Table']) . ']]>', 'sql');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('tables');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('block');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['sequence'], 'sequence');
- 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->outputNode($row['info_type'], 'info_type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$columnName = $row['columnname'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\App\Fields\Picklist::getValuesName($fieldname) as $picklistvalue) {
- 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 ('10' == $uiType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fieldRelModule) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fieldRelModule as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($valueFieldNumber->get('leading_zeros'), 'leading_zeros');
- Exclude checks
Line exceeds 120 characters; contains 158 characters Open
$treesExist = (new \App\Db\Query())->select(['name', 'access'])->from('vtiger_trees_templates')->where(['templateid' => $fieldParams])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($treesExist) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['label'], 'label');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('customview');
- Exclude checks
Line exceeds 120 characters; contains 178 characters Open
$entityField = (new \App\Db\Query())->select(['fieldname', 'entityidfield', 'entityidcolumn'])->from('vtiger_entityname')->where(['tabid' => $moduleInstance->id])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['presence'], 'presence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fieldname == $entityField['fieldname']) {
- Exclude checks
Line exceeds 120 characters; contains 159 characters Open
$fieldRelModule = (new \App\Db\Query())->select(['relmodule'])->from('vtiger_fieldmodulerel')->where(['fieldid' => $row['fieldid']])->column();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('relatedmodules');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($treesExist['access'], 'access');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_trees_templates_data')->where(['templateid' => $fieldParams])->createCommand()->query();
- 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
$this->outputNode($row['featured'], 'featured');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('fields');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($row['masseditable'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['masseditable'], 'masseditable');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($entityField['entityidcolumn'], 'entityidcolumn');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('15' == $uiType || '16' == $uiType || '111' == $uiType || '33' == $uiType || '55' == $uiType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('tree_value');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['state'], 'state');
- 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
$this->outputNode($row['presence'], 'presence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($cvRow = $cvColumnDataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$infoSchema = \App\Db::getInstance()->getTableSchema($tableName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('picklistvalues');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('numberInfo');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['name'], 'name');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['parentTree'], 'parentTree');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('tree_template');
- 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
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($setdefault, 'setdefault');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode('<![CDATA[' . $row['description'] . ']]>', 'description');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('customviews');
- 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
case '1':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case '2':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['label'], 'label');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['view_type'], 'view_type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['field_name'], 'field_name');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$actions = explode(',', $actionText);
- 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 ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('actions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['presence'], 'presence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['sequence'], 'sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['field_name'], 'field_name');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$moduleInstance->isentitytype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('relatedlist');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($actionText)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('actions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('relatedlist');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['name'], 'function');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['favorites'], 'favorites');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['view_type'], 'view_type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('field');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = $row['tablename'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($tableName, 'tablename');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['typeofdata'], 'typeofdata');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['summaryfield'], 'summaryfield');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row, 'relatedmodule');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($valueFieldNumber->get('cur_sequence'), 'cur_sequence');
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_trees_templates_data')->where(['templateid' => $fieldParams])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('tree_values');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export Custom views of the module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($fieldname, 'fieldname');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['viewname'], 'viewname');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rules = \App\CustomView::getConditions($cvid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['quickcreate'], 'quickcreate');
- 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->outputNode($row['fieldparams'], 'fieldparams');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportSharingAccess(ModuleBasic $moduleInstance)
- 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->openNode('sharingaccess');
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
$permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('fields');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$permissiontext = 'private';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['privileges'], 'privileges');
- 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
$this->outputNode($permissiontext, 'default');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($row) {
- 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->outputNode($row['sort'], 'sort');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Line exceeds 120 characters; contains 295 characters Open
$dataReader = (new \App\Db\Query())->select(['actionname'])->from('vtiger_profile2utility')->innerJoin('vtiger_actionmapping', 'vtiger_profile2utility.activityid = vtiger_actionmapping.actionid')->where(['tabid' => $moduleInstance->id])->distinct('actionname')->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($dataReader->count()) {
- 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
$dataReader->close();
- 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->outputNode($row['sequence'], 'sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fields as $field) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode('<![CDATA[' . $row['actionname'] . ']]>', 'name');
- 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
* Export related lists associated with module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fields = \App\Field::getFieldsFromRelation($row['relation_id'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('inrelatedlists');
- 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;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode(Module::getInstance($row['tabid'])->name, 'inrelatedmodule');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($actions as $action) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($dataReaderRow->count()) {
- 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 (!empty($actionText)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['creator_detail'], 'creator_detail');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('actions');
- 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
$actions = explode(',', $actionText);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('action');
- 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 (!$moduleInstance->isentitytype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleId = $moduleInstance->id;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode(Module::getInstance($row['related_tabid'])->name, 'relatedmodule');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($field, 'field');
- 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->openNode('inrelatedlist');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('fields');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($columnName, 'columnname');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('tree_template');
- 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
$entityField = (new \App\Db\Query())->select(['fieldname', 'entityidfield', 'entityidcolumn'])->from('vtiger_entityname')->where(['tabid' => $moduleInstance->id])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('customviews');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['sequence'], 'sequence');
- 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->outputNode($row['quickcreatesequence'], 'quickcreatesequence');
- 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
case '0':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case '3':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('picklistvalues');
- 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
$this->outputNode($valueFieldNumber->get('reset_sequence'), 'reset_sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param ModuleBasic $moduleInstance
- 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->outputNode($infoSchema->columns[$columnName]->dbType, 'columntype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode('', 'fieldparams');
- 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->outputNode($row['helpinfo'], 'helpinfo');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('tree_values');
- 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->openNode('relatedlists');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cvid = $row['cvid'];
- 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->outputNode($row['name'], 'function');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export picklist values for picklist fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['favorites'], 'favorites');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('field');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($picklistvalue, 'picklistvalue');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($valueFieldNumber->get('postfix'), 'postfix');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['creator_detail'], 'creator_detail');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode('<![CDATA[' . \App\Json::encode($rules) . ']]>', 'rules');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('tree_value');
- 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
$this->outputNode($row['relation_comment'], 'relation_comment');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$customViewDataReader->count()) {
- 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
foreach ($actions as $action) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cvColumnDataReader = (new \App\Db\Query())->from('vtiger_cvcolumnlist')->where(['cvid' => $cvid])->createCommand()->query();
- 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
* Export Sharing Access of the module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fields = \App\Field::getFieldsFromRelation($row['relation_id'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($permission as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('fields');
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['related_tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$permissiontext = 'public_readwrite';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['presence'], 'presence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('customview');
- 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->closeNode('sharingaccess');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReaderRow = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['related_tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($action, 'action');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['label'], 'label');
- 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 exportRelatedLists(ModuleBasic $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$actionText = $row['actions'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($action, 'action');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Relations in the opposite direction
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReaderRow->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['relation_comment'], 'relation_comment');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fields as $field) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldname = $row['fieldname'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['fieldlabel'], 'fieldlabel');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($valueFieldNumber->get('start_id'), 'start_id');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('numberInfo');
- 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->outputNode($treesExist['name'], 'name');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $customViewDataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cvRow['field_name'], 'fieldname');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cvRow['module_name'], 'modulename');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($cvRow['source_field_name']) {
- 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 (empty($permission)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($permission) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('actions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Export Entity Identifier Information
- 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->outputNode($valueFieldNumber->get('cur_id'), 'cur_id');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cvRow['columnindex'], 'columnindex');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($rules)) {
- 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;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('actions');
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$dataReader = (new \App\Db\Query())->from('vtiger_relatedlists')->where(['tabid' => $moduleId])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('fields');
- 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->openNode('fields');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uiType = $row['uitype'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($uiType, 'uitype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['generatedtype'], 'generatedtype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['maximumlength'], 'maximumlength');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldRelModule = (new \App\Db\Query())->select(['relmodule'])->from('vtiger_fieldmodulerel')->where(['fieldid' => $row['fieldid']])->column();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('4' == $uiType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($valueFieldNumber->get('prefix'), 'prefix');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cvRow['source_field_name'], 'sourcefieldname');
- 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
$this->closeNode('fields');
- 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->closeNode('relatedlists');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($entityField['entityidfield'], 'entityidfield');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('302' == $uiType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReaderRow->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['tree'], 'tree');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['depth'], 'depth');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$setmetrics = (1 == $row['setmetrics']) ? 'true' : 'false';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['sequence'], 'sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('field');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$customViewDataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$permissiontext = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['readonly'], 'readonly');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$permissiontext = 'public_readwritedelete';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['defaultvalue'], 'defaultvalue');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportActions(ModuleBasic $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$valueFieldNumber = \App\Fields\RecordNumber::getInstance($moduleInstance->id);
- 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
* @param ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->select(['actionname'])->from('vtiger_profile2utility')->innerJoin('vtiger_actionmapping', 'vtiger_profile2utility.activityid = vtiger_actionmapping.actionid')->where(['tabid' => $moduleInstance->id])->distinct('actionname')->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('action');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($setmetrics, 'setmetrics');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($dataReader->count()) {
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$cvColumnDataReader = (new \App\Db\Query())->from('vtiger_cvcolumnlist')->where(['cvid' => $cvid])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('actions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$actionText = $row['actions'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export actions.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode('enabled', 'status');
- 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->outputNode($field, 'field');
- 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
foreach ($customlinks as $customlink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('customlink');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cronTasks = Cron::listAllInstancesByModule($moduleInstance->name);
- 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
$this->openNode('customlinks');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('customlink');
- 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
$this->closeNode('inventory');
- 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
* Export custom links of the module.
- 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->outputNode($cronTask->getHandlerClass(), 'handler');
- 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
$dataReader = (new \App\Db\Query())->from(\Vtiger_Inventory_Model::getInstance($this->moduleInstance->name)->getTableName())->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('inventory');
- 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
$this->outputNode($cronTask->getSequence(), 'sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export module inventory fields.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('fields');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('fields');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReaderRow->close();
- 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
$customlinks = $moduleInstance->getLinksForExport();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode("<![CDATA[$customlink->linkicon]]>", 'linkicon');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportCronTasks(ModuleBasic $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('crons');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('crons');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['sequence'], 'sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['displaytype'], 'displaytype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('field');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cronTask->getName(), 'name');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cronTask->getFrequency(), 'frequency');
- Exclude checks
Line exceeds 120 characters; contains 159 characters Open
$dataReader = (new \App\Db\Query())->from(\Vtiger_Inventory_Model::getInstance($this->moduleInstance->name)->getTableName())->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('inrelatedlist');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode("<![CDATA[$customlink->linkurl]]>", 'linkurl');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode("<![CDATA[$customlink->handler_class]]>", 'handler_class');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode("<![CDATA[$customlink->handler]]>", 'handler');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Export cron tasks for the module.
- 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->outputNode($row['defaultvalue'], 'defaultvalue');
- 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 ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cronTask->getStatus(), 'status');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('cron');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['params'], 'params');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($customlink->linklabel, 'linklabel');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode("<![CDATA[$customlink->handler_path]]>", 'handler_path');
- 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
$this->outputNode($row['columnname'], 'columnname');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['block'], 'block');
- 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
$this->outputNode($customlink->linktype, 'linktype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 == $dataReader->count()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['label'], 'label');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($customlink->sequence, 'sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('customlinks');
- 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
foreach ($cronTasks as $cronTask) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($cronTask->getDescription(), 'description');
- 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
$this->outputNode($row['colspan'], 'colspan');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('fields');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($customlinks)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['invtype'], 'invtype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->outputNode($row['presence'], 'presence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('cron');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportInventory()
- 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
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->openNode('field');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeNode('inrelatedlists');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function exportCustomLinks(ModuleBasic $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
The method __copyLanguageFiles is not named in camelCase. Open
public function __copyLanguageFiles(\App\Zip $zip, $module)
{
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator('languages', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
if ($item->isFile() && $item->getFilename() === $module . '.json') {
$filePath = $item->getRealPath();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __getManifestFilePath is not named in camelCase. Open
public function __getManifestFilePath()
{
if (empty($this->_export_modulexml_filename)) {
// Set the module xml filename to be written for exporting.
$this->_export_modulexml_filename = 'manifest-' . time() . '.xml';
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __cleanupExport is not named in camelCase. Open
public function __cleanupExport()
{
if (!empty($this->_export_modulexml_filename)) {
unlink($this->__getManifestFilePath());
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __write is not named in camelCase. Open
public function __write($value)
{
fwrite($this->_export_modulexml_file, $value ?? '');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __finishExport is not named in camelCase. Open
public function __finishExport()
{
if (!empty($this->_export_modulexml_file)) {
fclose($this->_export_modulexml_file);
$this->_export_modulexml_file = null;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __initExport is not named in camelCase. Open
public function __initExport($module)
{
if ($this->moduleInstance->isentitytype) {
// We will be including the file, so do a security check.
Utils::checkFileAccessForInclusion("modules/$module/$module.php");
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}