Missing class import via use statement (line '117', column '26'). Open
$skill_obj = new SkillModel();
- 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 '118', column '31'). Open
$skill_rel_user = new SkillRelUserModel();
- 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 getChildren uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$skill = null;
}
- 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 '$order'. Open
$order = ''
- 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 $skill_id is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $add_child_info is not named in camelCase. Open
public function getSkillParents($skillId, $add_child_info = true)
{
$skillId = (int) $skillId;
$sql = 'SELECT child.* FROM '.$this->table.' child
LEFT JOIN '.$this->table.' parent
- 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 $user_id is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $skill_id is not named in camelCase. Open
public function relationExists($skill_id, $parent_id)
{
$result = $this->find(
'all',
[
- 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 $parent_id is not named in camelCase. Open
public function relationExists($skill_id, $parent_id)
{
$result = $this->find(
'all',
[
- 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 $load_user_data is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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
Variable "skill_obj" is not in valid camel caps format Open
$skill_obj = new SkillModel();
- Exclude checks
Variable "parent_id" is not in valid camel caps format Open
$parent_id,
- Exclude checks
Variable "add_child_info" is not in valid camel caps format Open
public function getSkillParents($skillId, $add_child_info = true)
- Exclude checks
Variable "load_user_data" is not in valid camel caps format Open
if ($load_user_data) {
- Exclude checks
Variable "passed_skills" is not in valid camel caps format Open
foreach ($passed_skills as $done_skill) {
- Exclude checks
Variable "done_skills" is not in valid camel caps format Open
$done_skills[] = $done_skill['skill_id'];
- Exclude checks
Variable "done_skills" is not in valid camel caps format Open
if (in_array($skill['skill_id'], $done_skills)) {
- Exclude checks
You must use "/**" style comments for a class comment Open
class SkillRelSkillModel extends Model
- Exclude checks
Variable "skill_rel_user" is not in valid camel caps format Open
$passed_skills = $skill_rel_user->getUserSkills($user_id);
- Exclude checks
Variable "skill_rel_user" is not in valid camel caps format Open
$skill_rel_user = new SkillRelUserModel();
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
$skill_id,
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
WHERE parent_id = '.$skill_id.'
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$passed_skills = $skill_rel_user->getUserSkills($user_id);
- Exclude checks
Variable "load_user_data" is not in valid camel caps format Open
$load_user_data = false,
- Exclude checks
Variable "done_skills" is not in valid camel caps format Open
$done_skills = [];
- Exclude checks
Variable "done_skills" is not in valid camel caps format Open
if (!empty($done_skills)) {
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
$skill_id,
- Exclude checks
Variable "skill_obj" is not in valid camel caps format Open
$skill['data'] = $skill_obj->get($skill['skill_id']);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$user_id = false,
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
$skill_id = (int) $skill_id;
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
$skill_id = (int) $skill_id;
- Exclude checks
Variable "done_skill" is not in valid camel caps format Open
$done_skills[] = $done_skill['skill_id'];
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
public function relationExists($skill_id, $parent_id)
- Exclude checks
Variable "passed_skills" is not in valid camel caps format Open
$passed_skills = $skill_rel_user->getUserSkills($user_id);
- Exclude checks
Variable "done_skill" is not in valid camel caps format Open
foreach ($passed_skills as $done_skill) {
- Exclude checks
Variable "add_child_info" is not in valid camel caps format Open
if ($add_child_info) {
- Exclude checks
Variable "parent_id" is not in valid camel caps format Open
public function relationExists($skill_id, $parent_id)
- Exclude checks
The variable $skill_rel_user is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $done_skills is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $skill_id is not named in camelCase. Open
public function relationExists($skill_id, $parent_id)
{
$result = $this->find(
'all',
[
- 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 $done_skills is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $load_user_data is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $skill_rel_user is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $done_skills is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $skill_obj is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $skill_id is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $done_skill is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $skill_id is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $parent_id is not named in camelCase. Open
public function relationExists($skill_id, $parent_id)
{
$result = $this->find(
'all',
[
- 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 $skill_id is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $skill_obj is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $passed_skills is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $done_skill is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $user_id is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $passed_skills is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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 $add_child_info is not named in camelCase. Open
public function getSkillParents($skillId, $add_child_info = true)
{
$skillId = (int) $skillId;
$sql = 'SELECT child.* FROM '.$this->table.' child
LEFT JOIN '.$this->table.' parent
- 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 $done_skills is not named in camelCase. Open
public function getChildren(
$skill_id,
$load_user_data = false,
$user_id = false,
$order = ''
- 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();
}
}