The method parseColumnList() has an NPath complexity of 1154. The configured NPath complexity threshold is 200. Open
public static function parseColumnList($groupCourseList, $columnList, &$graph, &$connections, $userResult)
{
$graphHtml = '';
$oldGroup = null;
$newOrder = [];
- 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 renderDiagramByColumn() has an NPath complexity of 8775696384. The configured NPath complexity threshold is 200. Open
public static function renderDiagramByColumn($careerInfo, $tpl, $loadUserIdData = 0)
{
$careerId = isset($careerInfo['id']) ? $careerInfo['id'] : 0;
if (empty($careerId)) {
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 renderDiagram() has an NPath complexity of 50400. The configured NPath complexity threshold is 200. Open
public static function renderDiagram($careerInfo, $graph)
{
if (!($graph instanceof Graph)) {
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 parseSubGroups() has an NPath complexity of 53790984. The configured NPath complexity threshold is 200. Open
public static function parseSubGroups(
$groupCourseList,
$group,
$groupLabel,
$showGroupLine,
- 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 parseVertexList() has an NPath complexity of 5804674. The configured NPath complexity threshold is 200. Open
public static function parseVertexList($groupCourseList, $vertexList, $addRow, &$graph, $group, &$connections, $userResult)
{
if (empty($vertexList)) {
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
Avoid using undefined variables such as '$newOrder' which will lead to PHP notices. Open
$newOrder[$newGroup]['label'] = $label;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$params['id'] = $item['id'];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$params['status'] = $status;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$newOrder' which will lead to PHP notices. Open
$newOrder[$newGroup]['items'][] = $subGroupList;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$promotion->update($params);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$promotion->update_all_sessions_status_by_promotion_id($params['id'], $status);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
The class Career has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. Open
class Career extends Model
{
public $table;
public $columns = [
'id',
- 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 '140', column '31'). Open
$extraField = new ExtraField('career');
- 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 '114', column '21'). Open
$form = new FormValidator('career', 'post', $url);
- 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 '622', column '22'). Open
$graph = new stdClass();
- 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 '274', column '37'). Open
$extraFieldValues = new ExtraFieldValue('career');
- 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 '463', column '32'). Open
$extraFieldValue = new ExtraFieldValue('career');
- 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 '60', column '26'). Open
$promotion = new Promotion();
- 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 '201', column '30'). Open
$promotion = new Promotion();
- 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 parseSubGroups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$defaultSubGroup = (int) $subGroup;
}
- 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
The method renderDiagram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Course block (row_123 id)
if (!empty($explode[0])) {
$firstConnection = 'row_'.(int) $explode[0];
}
- 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 '1058', column '40'). Open
public static function parseVertexList($groupCourseList, $vertexList, $addRow, &$graph, $group, &$connections, $userResult)
{
if (empty($vertexList)) {
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
The method return_form uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$form->addButtonCreate(get_lang('Add'));
}
- 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
The method renderDiagram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// subgroup__123 id
$firstConnection = 'subgroup_'.(int) str_replace('SG', '', $explode[0]);
}
- 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
The method renderDiagramByColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Course block (row_123 id)
if (!empty($explode[0])) {
$simpleFirstConnection = 'v'.$explode[0];
}
- 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
The method renderDiagram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Course block (row_123 id)
if (!empty($explode[0])) {
$secondConnection = 'row_'.(int) $explode[1];
}
- 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
The method parseSubGroups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$subGroupCountList[$defaultSubGroup]++;
}
- 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
The method renderDiagramByColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Course block (row_123 id)
if (!empty($explode[0]) && isset($explode[1])) {
$simpleSecondConnection = 'v'.(int) $explode[1];
}
- 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
The method parseSubGroups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$parts = explode('SG', $arrow);
if (empty($parts[0]) && 2 == count($parts)) {
$subGroupArrow = $parts[1];
$graphHtml .= self::createConnection(
- 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
The method renderDiagramByColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$simpleSecondConnection = 'sg'.(int) str_replace('SG', '', $explode[1]);
}
- 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
The method renderDiagramByColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// subgroup__123 id
$simpleFirstConnection = 'sg'.(int) str_replace('SG', '', $explode[0]);
}
- 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 '1063', column '40'). Open
public static function parseVertexList($groupCourseList, $vertexList, $addRow, &$graph, $group, &$connections, $userResult)
{
if (empty($vertexList)) {
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
The method parseSubGroups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$subGroupAdded[$subGroup]++;
}
- 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
The method renderDiagram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$secondConnection = 'subgroup_'.(int) str_replace('SG', '', $explode[1]);
}
- 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
The method parseVertexList uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Case is only one subgroup value example: SG1
$parts = explode('SG', $arrow);
if (empty($parts[0]) && 2 == count($parts)) {
$subGroupArrow = $parts[1];
- 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 unused parameters such as '$showQuery'. Open
public function save($params, $showQuery = false)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused local variables such as '$topValue'. Open
$topValue = 90;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$key'. Open
foreach ($columnList as $key => $subGroupList) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$oldGroup'. Open
$oldGroup = null;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$size'. Open
$size = 2;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused parameters such as '$careerInfo'. Open
public static function renderDiagram($careerInfo, $graph)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The parameter $career_id is not named in camelCase. Open
public function update_all_promotion_status_by_career_id($career_id, $status)
{
$promotion = new Promotion();
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
if (!empty($promotion_list)) {
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $copy_promotions is not named in camelCase. Open
public function copy($id, $copy_promotions = false)
{
$career = $this->get($id);
$new = [];
foreach ($career as $key => $val) {
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $career_id is not named in camelCase. Open
public function get_status($career_id)
{
$table = Database::get_main_table(TABLE_CAREER);
$career_id = (int) $career_id;
$sql = "SELECT status FROM $table WHERE id = '$career_id'";
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Missing class doc comment Open
class Career extends Model
- Exclude checks
Method name "Career::get_status_list" is not in camel caps format Open
public function get_status_list()
- Exclude checks
Variable "career_id" is not in valid camel caps format Open
public function get_status($career_id)
- Exclude checks
Missing parameter name Open
* @param $widthGroup
- Exclude checks
Variable "career_id" is not in valid camel caps format Open
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
- Exclude checks
Missing parameter name Open
* @param bool Whether or not to copy the promotions inside
- Exclude checks
Variable "copy_promotions" is not in valid camel caps format Open
public function copy($id, $copy_promotions = false)
- Exclude checks
Method name "Career::update_all_promotion_status_by_career_id" is not in camel caps format Open
public function update_all_promotion_status_by_career_id($career_id, $status)
- Exclude checks
Variable "promotion_list" is not in valid camel caps format Open
foreach ($promotion_list as $item) {
- Exclude checks
Missing parameter name Open
* @param $graph
- Exclude checks
Expected 6 spaces after parameter type; 2 found Open
* @param array $subGroupList
- Exclude checks
Variable "status_list" is not in valid camel caps format Open
$form->addSelect('status', get_lang('Status'), $status_list);
- Exclude checks
Missing function doc comment Open
public function get_all(array $options = []): array
- Exclude checks
Variable "promo_list" is not in valid camel caps format Open
foreach ($promo_list as $item) {
- Exclude checks
Missing parameter name Open
* @param $userResult
- Exclude checks
Expected 6 spaces after parameter type; 2 found Open
* @param array $groupCourseList list of groups and their courses
- Exclude checks
Method name "Career::get_all" is not in camel caps format Open
public function get_all(array $options = []): array
- Exclude checks
Variable "career_id" is not in valid camel caps format Open
public function update_all_promotion_status_by_career_id($career_id, $status)
- Exclude checks
Variable "promotion_list" is not in valid camel caps format Open
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
- Exclude checks
Method name "Career::return_form" is not in camel caps format Open
public function return_form($url, $action)
- Exclude checks
Missing parameter name Open
* @param int Career ID
- Exclude checks
Missing parameter name Open
* @param array
- Exclude checks
Variable "promotion_list" is not in valid camel caps format Open
if (!empty($promotion_list)) {
- Exclude checks
Variable "status_list" is not in valid camel caps format Open
$status_list = $this->get_status_list();
- Exclude checks
Variable "promo_list" is not in valid camel caps format Open
$promo_list = $promotion->get_all_promotions_by_career_id($id);
- Exclude checks
Missing parameter name Open
* @param $connections
- Exclude checks
Expected 7 spaces after parameter type; 3 found Open
* @param bool $showGroupLine
- Exclude checks
Missing function doc comment Open
public function __construct()
- Exclude checks
Method name "Career::get_count" is not in camel caps format Open
public function get_count()
- Exclude checks
Variable "copy_promotions" is not in valid camel caps format Open
if ($copy_promotions) {
- Exclude checks
Variable "career_id" is not in valid camel caps format Open
$career_id = (int) $career_id;
- Exclude checks
Variable "promo_list" is not in valid camel caps format Open
if (!empty($promo_list)) {
- Exclude checks
Variable "career_id" is not in valid camel caps format Open
$sql = "SELECT status FROM $table WHERE id = '$career_id'";
- Exclude checks
Missing parameter name Open
* @param $groupCourseList
- Exclude checks
Expected 5 spaces after parameter type; 1 found Open
* @param string $groupLabel
- Exclude checks
Expected 8 spaces after parameter type; 4 found Open
* @param int $group
- Exclude checks
Variable "career_id" is not in valid camel caps format Open
$career_id = (int) $career_id;
- Exclude checks
Method name "Career::get_status" is not in camel caps format Open
public function get_status($career_id)
- Exclude checks
Missing parameter name Open
* @param $columnList
- Exclude checks
The 'get_status()' method which returns a boolean should be named 'is...()' or 'has...()' Open
public function get_status($career_id)
{
$table = Database::get_main_table(TABLE_CAREER);
$career_id = (int) $career_id;
$sql = "SELECT status FROM $table WHERE id = '$career_id'";
- Read upRead up
- Exclude checks
BooleanGetMethodName
Since: 0.2
Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.
Example
class Foo {
/**
* @return boolean
*/
public function getFoo() {} // bad
/**
* @return bool
*/
public function isFoo(); // ok
/**
* @return boolean
*/
public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}
Source https://phpmd.org/rules/naming.html#booleangetmethodname
The variable $promotion_list is not named in camelCase. Open
public function update_all_promotion_status_by_career_id($career_id, $status)
{
$promotion = new Promotion();
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
if (!empty($promotion_list)) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $career_id is not named in camelCase. Open
public function update_all_promotion_status_by_career_id($career_id, $status)
{
$promotion = new Promotion();
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
if (!empty($promotion_list)) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $promotion_list is not named in camelCase. Open
public function update_all_promotion_status_by_career_id($career_id, $status)
{
$promotion = new Promotion();
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
if (!empty($promotion_list)) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $promotion_list is not named in camelCase. Open
public function update_all_promotion_status_by_career_id($career_id, $status)
{
$promotion = new Promotion();
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
if (!empty($promotion_list)) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $status_list is not named in camelCase. Open
public function return_form($url, $action)
{
$form = new FormValidator('career', 'post', $url);
// Setting the form elements
$header = get_lang('Add');
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $promo_list is not named in camelCase. Open
public function copy($id, $copy_promotions = false)
{
$career = $this->get($id);
$new = [];
foreach ($career as $key => $val) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $career_id is not named in camelCase. Open
public function get_status($career_id)
{
$table = Database::get_main_table(TABLE_CAREER);
$career_id = (int) $career_id;
$sql = "SELECT status FROM $table WHERE id = '$career_id'";
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $career_id is not named in camelCase. Open
public function get_status($career_id)
{
$table = Database::get_main_table(TABLE_CAREER);
$career_id = (int) $career_id;
$sql = "SELECT status FROM $table WHERE id = '$career_id'";
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $copy_promotions is not named in camelCase. Open
public function copy($id, $copy_promotions = false)
{
$career = $this->get($id);
$new = [];
foreach ($career as $key => $val) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $career_id is not named in camelCase. Open
public function get_status($career_id)
{
$table = Database::get_main_table(TABLE_CAREER);
$career_id = (int) $career_id;
$sql = "SELECT status FROM $table WHERE id = '$career_id'";
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $status_list is not named in camelCase. Open
public function return_form($url, $action)
{
$form = new FormValidator('career', 'post', $url);
// Setting the form elements
$header = get_lang('Add');
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $promo_list is not named in camelCase. Open
public function copy($id, $copy_promotions = false)
{
$career = $this->get($id);
$new = [];
foreach ($career as $key => $val) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $promo_list is not named in camelCase. Open
public function copy($id, $copy_promotions = false)
{
$career = $this->get($id);
$new = [];
foreach ($career as $key => $val) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method get_count is not named in camelCase. Open
public function get_count()
{
$row = Database::select(
'count(*) as count',
$this->table,
- 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 get_all is not named in camelCase. Open
public function get_all(array $options = []): array
{
return Database::select(
'*',
$this->table,
- 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 update_all_promotion_status_by_career_id is not named in camelCase. Open
public function update_all_promotion_status_by_career_id($career_id, $status)
{
$promotion = new Promotion();
$promotion_list = $promotion->get_all_promotions_by_career_id($career_id);
if (!empty($promotion_list)) {
- 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 return_form is not named in camelCase. Open
public function return_form($url, $action)
{
$form = new FormValidator('career', 'post', $url);
// Setting the form elements
$header = get_lang('Add');
- 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 get_status_list is not named in camelCase. Open
public function get_status_list()
{
return [
CareerEntity::CAREER_STATUS_ACTIVE => get_lang('Unarchived'),
CareerEntity::CAREER_STATUS_INACTIVE => get_lang('Archived'),
- 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 get_status is not named in camelCase. Open
public function get_status($career_id)
{
$table = Database::get_main_table(TABLE_CAREER);
$career_id = (int) $career_id;
$sql = "SELECT status FROM $table WHERE id = '$career_id'";
- 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() {
}
}