Showing 910 of 910 total issues
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class ELearn_Views_Lesson
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class ELearn_Views_Part
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class ELearn_Views_Course
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class ELearn_Views_Topic
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class ELearn_Vote extends Pluf_Model
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class ELearn_Views{
- Exclude checks
Function remove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function remove($request, $match)
{
if (isset($match['topicId'])) {
$topicId = $match['topicId'];
} else {
- 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 get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function get($request, $match)
{
// Check and fetch Part
if (array_key_exists('partId', $match)) {
$part = Pluf_Shortcuts_GetObjectOr404('ELearn_Part', $match['partId']);
- 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 remove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function remove($request, $match)
{
if (isset($match['lessonId'])) {
$lessonId = $match['lessonId'];
} else {
- 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 remove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function remove($request, $match)
{
if (isset($match['courseId'])) {
$courseId = $match['courseId'];
} else {
- 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 remove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function remove($request, $match)
{
// Check and fetch Part
if (isset($match['partId'])) {
$partId = $match['partId'];
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 12 and the first side effect is on line 2. Open
<?php
- Exclude checks
The class ELearn_PartHistory is not named in CamelCase. Open
class ELearn_PartHistory extends Pluf_Model
{
/**
* @brief مدل دادهای را بارگذاری میکند.
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The property $list_filters is not named in camelCase. Open
class ELearn_Searcher
{
/**
* این مدل دادهای جستجوگر خواهد شد.
- 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
Avoid variables with short names like $p. Configured minimum length is 3. Open
public static function create($request, $match, $p)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
private static function validatePart($request, $match, $id){
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The class ELearn_Lesson is not named in CamelCase. Open
class ELearn_Lesson extends Pluf_Model
{
/**
* @brief مدل دادهای را بارگذاری میکند.
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The property $sort_fields is not named in camelCase. Open
class ELearn_Searcher
{
/**
* این مدل دادهای جستجوگر خواهد شد.
- 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 $sort_reverse_order is not named in camelCase. Open
class ELearn_Searcher
{
/**
* این مدل دادهای جستجوگر خواهد شد.
- 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
Avoid variables with short names like $s. Configured minimum length is 3. Open
$s = $this->sort_order[1];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}