The method updateGradeBookListBySkill() has an NPath complexity of 252. The configured NPath complexity threshold is 200. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_id]]]
- 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 updateBySkill uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$result = $this->save($params);
}
- 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 parameter $skill_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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
The parameter $gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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
The parameter $skill_id is not named in camelCase. Open
public function getSkillInfo($skill_id, $gradebookId)
{
if (empty($skill_id)) {
return [];
}
- 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_id" is not in valid camel caps format Open
'skill_id' => $skill_id,
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
public function getSkillInfo($skill_id, $gradebookId)
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
- Exclude checks
You must use "/**" style comments for a class comment Open
class SkillRelGradebookModel extends Model
- Exclude checks
Variable "gradebooks_to_remove" is not in valid camel caps format Open
$gradebooks_to_remove = [];
- Exclude checks
Variable "gradebook_list" is not in valid camel caps format Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
$skill_id,
- Exclude checks
Variable "original_gradebook_list_ids" is not in valid camel caps format Open
$original_gradebook_list_ids[] = $gradebook_item['gradebook_id'];
- Exclude checks
Variable "gradebook_id" is not in valid camel caps format Open
foreach ($gradebook_list as $gradebook_id) {
- Exclude checks
Variable "gradebooks_to_add" is not in valid camel caps format Open
if (!empty($gradebooks_to_add)) {
- Exclude checks
Missing function doc comment Open
public function __construct()
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
if (empty($skill_id)) {
- Exclude checks
Variable "original_gradebook_list" is not in valid camel caps format Open
if (!empty($original_gradebook_list)) {
- Exclude checks
Variable "gradebooks_to_remove" is not in valid camel caps format Open
$gradebooks_to_remove[] = $gradebook['id'];
- Exclude checks
Variable "gradebook_item" is not in valid camel caps format Open
$original_gradebook_list_ids[] = $gradebook_item['gradebook_id'];
- Exclude checks
Variable "gradebooks_to_add" is not in valid camel caps format Open
$gradebooks_to_add[] = $gradebook_id;
- Exclude checks
Variable "skill_id" is not in valid camel caps format Open
['where' => ['skill_id = ?' => [$skill_id]]]
- Exclude checks
Variable "gradebook_list" is not in valid camel caps format Open
foreach ($gradebook_list as $gradebook_id) {
- Exclude checks
Variable "gradebook_id" is not in valid camel caps format Open
if (!in_array($gradebook_id, $original_gradebook_list_ids)) {
- Exclude checks
Variable "gradebook_item" is not in valid camel caps format Open
foreach ($original_gradebook_list as $gradebook_item) {
- Exclude checks
Variable "original_gradebook_list_ids" is not in valid camel caps format Open
if (!in_array($gradebook_id, $original_gradebook_list_ids)) {
- Exclude checks
Variable "original_gradebook_list" is not in valid camel caps format Open
$original_gradebook_list = $this->find(
- Exclude checks
Variable "original_gradebook_list_ids" is not in valid camel caps format Open
$original_gradebook_list_ids = [];
- Exclude checks
Variable "gradebook_list" is not in valid camel caps format Open
if (!empty($gradebook_list)) {
- Exclude checks
Variable "gradebook_list" is not in valid camel caps format Open
if (!in_array($gradebook['gradebook_id'], $gradebook_list)) {
- Exclude checks
Variable "gradebook_id" is not in valid camel caps format Open
$gradebooks_to_add[] = $gradebook_id;
- Exclude checks
Variable "gradebooks_to_remove" is not in valid camel caps format Open
foreach ($gradebooks_to_remove as $id) {
- Exclude checks
Variable "gradebooks_to_add" is not in valid camel caps format Open
foreach ($gradebooks_to_add as $gradebook_id) {
- Exclude checks
Variable "gradebook_id" is not in valid camel caps format Open
foreach ($gradebooks_to_add as $gradebook_id) {
- Exclude checks
Variable "original_gradebook_list" is not in valid camel caps format Open
foreach ($original_gradebook_list as $gradebook_item) {
- Exclude checks
Variable "original_gradebook_list" is not in valid camel caps format Open
foreach ($original_gradebook_list as $gradebook) {
- Exclude checks
Variable "gradebooks_to_remove" is not in valid camel caps format Open
if (!empty($gradebooks_to_remove)) {
- Exclude checks
Variable "gradebook_id" is not in valid camel caps format Open
'gradebook_id' => $gradebook_id,
- Exclude checks
Variable "gradebooks_to_add" is not in valid camel caps format Open
$gradebooks_to_add = [];
- Exclude checks
The variable $gradebook_item is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $original_gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebooks_to_remove is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $original_gradebook_list_ids is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $original_gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebooks_to_remove is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $skill_id is not named in camelCase. Open
public function getSkillInfo($skill_id, $gradebookId)
{
if (empty($skill_id)) {
return [];
}
- 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 $gradebooks_to_add is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $original_gradebook_list_ids is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $skill_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $original_gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_item is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $original_gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $skill_id is not named in camelCase. Open
public function getSkillInfo($skill_id, $gradebookId)
{
if (empty($skill_id)) {
return [];
}
- 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 $gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_list is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebooks_to_add is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebooks_to_remove is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $original_gradebook_list_ids is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebooks_to_remove is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $skill_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebooks_to_add is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebook_id is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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 $gradebooks_to_add is not named in camelCase. Open
public function updateGradeBookListBySkill($skill_id, $gradebook_list)
{
$original_gradebook_list = $this->find(
'all',
['where' => ['skill_id = ?' => [$skill_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();
}
}