The method save() has an NPath complexity of 336. The configured NPath complexity threshold is 200. Open
public function save($params, $showQuery = false)
{
$params = $this->clean_parameters($params);
if ($this->is_course_model) {
- 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 property $is_course_model is not named in camelCase. Open
class Model
{
public $table;
public $columns;
public array $required;
- 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
Variable "is_course_model" is not in valid camel caps format Open
if ($this->is_course_model) {
- Exclude checks
Method name "Model::get_all" is not in camel caps format Open
public function get_all(array $options = []): array
- Exclude checks
Variable "key_params" is not in valid camel caps format Open
$key_params = array_keys($params);
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course_id = api_get_course_int_id();
- Exclude checks
Variable "is_course_model" is not in valid camel caps format Open
if ($this->is_course_model) {
- Exclude checks
Variable "clean_params" is not in valid camel caps format Open
return $clean_params;
- Exclude checks
Variable "is_course_model" is not in valid camel caps format Open
if ($this->is_course_model) {
- Exclude checks
Variable "require_ok" is not in valid camel caps format Open
if (!$require_ok) {
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$params = ['id = ? AND c_id = ?' => [$id, $course_id]];
- Exclude checks
Variable "require_ok" is not in valid camel caps format Open
$require_ok = false;
- Exclude checks
Variable "clean_params" is not in valid camel caps format Open
$clean_params = [];
- Exclude checks
Variable "require_ok" is not in valid camel caps format Open
$require_ok = true;
- Exclude checks
Missing function doc comment Open
public function get_all(array $options = []): array
- Exclude checks
Variable "is_course_model" is not in valid camel caps format Open
if ($this->is_course_model) {
- Exclude checks
Variable "clean_params" is not in valid camel caps format Open
$clean_params[$key] = $value;
- Exclude checks
Method name "Model::get_count" is not in camel caps format Open
public function get_count()
- Exclude checks
Member variable "is_course_model" is not in valid camel caps format Open
public $is_course_model = false;
- Exclude checks
Missing function doc comment Open
public function __construct()
- Exclude checks
Variable "key_params" is not in valid camel caps format Open
if (!in_array($field, $key_params)) {
- Exclude checks
Method name "Model::clean_parameters" is not in camel caps format Open
private function clean_parameters($params)
- Exclude checks
The variable $require_ok is not named in camelCase. Open
public function save($params, $showQuery = false)
{
$params = $this->clean_parameters($params);
if ($this->is_course_model) {
- 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 $clean_params is not named in camelCase. Open
private function clean_parameters($params)
{
$clean_params = [];
if (!empty($params)) {
foreach ($params as $key => $value) {
- 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 $clean_params is not named in camelCase. Open
private function clean_parameters($params)
{
$clean_params = [];
if (!empty($params)) {
foreach ($params as $key => $value) {
- 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 $course_id is not named in camelCase. Open
public function get($id)
{
if (empty($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 $key_params is not named in camelCase. Open
public function save($params, $showQuery = false)
{
$params = $this->clean_parameters($params);
if ($this->is_course_model) {
- 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 $clean_params is not named in camelCase. Open
private function clean_parameters($params)
{
$clean_params = [];
if (!empty($params)) {
foreach ($params as $key => $value) {
- 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 $require_ok is not named in camelCase. Open
public function save($params, $showQuery = false)
{
$params = $this->clean_parameters($params);
if ($this->is_course_model) {
- 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 $key_params is not named in camelCase. Open
public function save($params, $showQuery = false)
{
$params = $this->clean_parameters($params);
if ($this->is_course_model) {
- 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 $course_id is not named in camelCase. Open
public function get($id)
{
if (empty($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 $require_ok is not named in camelCase. Open
public function save($params, $showQuery = false)
{
$params = $this->clean_parameters($params);
if ($this->is_course_model) {
- 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 clean_parameters is not named in camelCase. Open
private function clean_parameters($params)
{
$clean_params = [];
if (!empty($params)) {
foreach ($params as $key => $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 get_all is not named in camelCase. Open
public function get_all(array $options = []): array
{
return Database::select('*', $this->table, $options);
}
- 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_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() {
}
}