The method install_course_fields() has an NPath complexity of 204. The configured NPath complexity threshold is 200. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 getSettingsForm() has an NPath complexity of 6872. The configured NPath complexity threshold is 200. Open
public function getSettingsForm()
{
$result = new FormValidator($this->get_name());
$defaults = [];
- 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
Missing class import via use statement (line '205', column '23'). Open
$result = new FormValidator($this->get_name());
- 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
Avoid assigning values to variables in if clauses and the like (line '211', column '13'). Open
public function getSettingsForm()
{
$result = new FormValidator($this->get_name());
$defaults = [];
- 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
Avoid assigning values to variables in if clauses and the like (line '99', column '13'). Open
public function get_info()
{
$result = [];
$result['obj'] = $this;
$result['title'] = $this->get_title();
- 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 manageTab uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$settingsCurrentTable = Database::get_main_table(TABLE_MAIN_SETTINGS);
$conditions = [
'where' => [
"variable = 'show_tabs' AND title = ? AND comment = ? " => [
- 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 install_course_fields uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$sql = "SELECT value FROM $t_course
WHERE c_id = $courseId AND variable = '$variable' ";
$result = Database::query($sql);
if (!Database::num_rows($result)) {
- 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 getCourseSettings uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$settings[] = $item['name'];
}
- 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 local variables such as '$key'. Open
foreach ($type['options'] as $key => &$optionName) {
- 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 '$values'. Open
public function course_settings_updated($values = [])
- 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 parameters such as '$variable'. Open
public function validateCourseSetting($variable)
- 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 parameters such as '$region'. Open
public function renderRegion($region)
- 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 parameters such as '$userId'. Open
public function doWhenDeletingUser($userId)
- 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 parameters such as '$courseId'. Open
public function doWhenDeletingCourse($courseId)
- 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 parameters such as '$sessionId'. Open
public function doWhenDeletingSession($sessionId)
- 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 property $course_settings_callback is not named in camelCase. Open
class Plugin
{
const TAB_FILTER_NO_STUDENT = '::no-student';
const TAB_FILTER_ONLY_STUDENT = '::only-student';
public $isCoursePlugin = false;
- 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 $course_settings is not named in camelCase. Open
class Plugin
{
const TAB_FILTER_NO_STUDENT = '::no-student';
const TAB_FILTER_ONLY_STUDENT = '::only-student';
public $isCoursePlugin = false;
- 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 parameter $add_tool_link is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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_tool_link is not named in camelCase. Open
public function install_course_fields_in_all_courses($add_tool_link = true)
{
// Update existing courses to add plugin settings
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id FROM $table ORDER BY 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
Method name "Plugin::course_install" is not in camel caps format Open
public function course_install($courseId, $addToolLink = true)
- Exclude checks
Variable "t_course" is not in valid camel caps format Open
Database::insert($t_course, $params);
- Exclude checks
Variable "t_course" is not in valid camel caps format Open
$sql = "DELETE FROM $t_course
- Exclude checks
Variable "course_settings" is not in valid camel caps format Open
if (is_array($this->course_settings)) {
- Exclude checks
Method name "Plugin::course_settings_updated" is not in camel caps format Open
public function course_settings_updated($values = [])
- Exclude checks
Variable "language_interface" is not in valid camel caps format Open
$language_interface = api_get_setting('platformLanguage');
- Exclude checks
Variable "add_tool_link" is not in valid camel caps format Open
public function install_course_fields($courseId, $add_tool_link = true)
- Exclude checks
Variable "add_tool_link" is not in valid camel caps format Open
if (!$add_tool_link || false == $this->addCourseTool) {
- Exclude checks
Member variable "course_settings" is not in valid camel caps format Open
public $course_settings = [];
- Exclude checks
Method name "Plugin::get_lang_plugin_exists" is not in camel caps format Open
public function get_lang_plugin_exists($name)
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
$pluginGlobalValue = api_get_plugin_setting($plugin_name, $variable);
- Exclude checks
Variable "t_tool" is not in valid camel caps format Open
$sql = "DELETE FROM $t_tool
- Exclude checks
Method name "Plugin::get_settings" is not in camel caps format Open
public function get_settings($forceFromDB = false)
- Exclude checks
Variable "language_interface" is not in valid camel caps format Open
$interfaceLanguageId = api_get_language_id($language_interface);
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
$parentPath = "{$root}{$plugin_name}/lang/{$languageParentFolder}.php";
- Exclude checks
Variable "add_tool_link" is not in valid camel caps format Open
$this->install_course_fields($row['id'], $add_tool_link);
- Exclude checks
Variable "course_settings" is not in valid camel caps format Open
foreach ($this->course_settings as $item) {
- Exclude checks
Variable "language_files" is not in valid camel caps format Open
global $language_files;
- Exclude checks
Method name "Plugin::get_lang" is not in camel caps format Open
public function get_lang($name)
- Exclude checks
Variable "language_interface" is not in valid camel caps format Open
$interfaceLanguageId = api_get_language_id($language_interface);
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
$english_path = $root.$plugin_name."/lang/english.php";
- Exclude checks
Variable "english_path" is not in valid camel caps format Open
include $english_path;
- Exclude checks
Variable "t_tool" is not in valid camel caps format Open
$t_tool = Database::get_course_table(TABLE_TOOL_LIST);
- Exclude checks
Variable "language_interface" is not in valid camel caps format Open
$language_interface = api_get_language_isocode();
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
$plugin_name = $this->get_name();
- Exclude checks
Variable "t_course" is not in valid camel caps format Open
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
- Exclude checks
Variable "t_course" is not in valid camel caps format Open
$sql = "SELECT value FROM $t_course
- Exclude checks
Variable "add_tool_link" is not in valid camel caps format Open
public function install_course_fields_in_all_courses($add_tool_link = true)
- Exclude checks
Method name "Plugin::get_comment" is not in camel caps format Open
public function get_comment()
- Exclude checks
Variable "t_course" is not in valid camel caps format Open
FROM $t_course
- Exclude checks
Variable "course_settings" is not in valid camel caps format Open
if (!empty($this->course_settings)) {
- Exclude checks
Method name "Plugin::uninstall_course_fields_in_all_courses" is not in camel caps format Open
public function uninstall_course_fields_in_all_courses()
- Exclude checks
Method name "Plugin::get_version" is not in camel caps format Open
public function get_version()
- Exclude checks
Variable "english_path" is not in valid camel caps format Open
$english_path = $root.$plugin_name."/lang/english.php";
- Exclude checks
Method name "Plugin::uninstall_course_fields" is not in camel caps format Open
public function uninstall_course_fields($courseId)
- Exclude checks
Method name "Plugin::install_course_fields_in_all_courses" is not in camel caps format Open
public function install_course_fields_in_all_courses($add_tool_link = true)
- Exclude checks
Variable "language_files" is not in valid camel caps format Open
$language_files[] = 'plugin_'.$this->get_name();
- Exclude checks
Method name "Plugin::get_title" is not in camel caps format Open
public function get_title()
- Exclude checks
Variable "course_settings" is not in valid camel caps format Open
foreach ($this->course_settings as $setting) {
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
'subkey' => $plugin_name,
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
$this->createLinkToCourseTool($plugin_name, $courseId);
- Exclude checks
Method name "Plugin::get_name" is not in camel caps format Open
public function get_name()
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
$path = $root.$plugin_name."/lang/$language_interface.php";
- Exclude checks
Variable "course_settings" is not in valid camel caps format Open
if (!empty($this->course_settings)) {
- Exclude checks
Member variable "course_settings_callback" is not in valid camel caps format Open
public $course_settings_callback = false;
- Exclude checks
Method name "Plugin::get_css" is not in camel caps format Open
public function get_css()
- Exclude checks
Variable "english_path" is not in valid camel caps format Open
if (is_readable($english_path)) {
- Exclude checks
Variable "language_interface" is not in valid camel caps format Open
$path = $root.$plugin_name."/lang/$language_interface.php";
- Exclude checks
Variable "course_settings" is not in valid camel caps format Open
foreach ($this->course_settings as $setting) {
- Exclude checks
Variable "t_course" is not in valid camel caps format Open
Database::insert($t_course, $params);
- Exclude checks
Method name "Plugin::get_info" is not in camel caps format Open
public function get_info()
- Exclude checks
Method name "Plugin::get_author" is not in camel caps format Open
public function get_author()
- Exclude checks
Method name "Plugin::install_course_fields" is not in camel caps format Open
public function install_course_fields($courseId, $add_tool_link = true)
- Exclude checks
Variable "plugin_name" is not in valid camel caps format Open
$plugin_name = $this->get_name();
- Exclude checks
Variable "t_course" is not in valid camel caps format Open
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
- Exclude checks
The 'get_lang_plugin_exists()' method which returns a boolean should be named 'is...()' or 'has...()' Open
public function get_lang_plugin_exists($name)
{
return isset($this->strings[$name]);
}
- 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 $english_path is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $plugin_name is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $plugin_name is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $t_course is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $language_files is not named in camelCase. Open
protected function __construct($version, $author, $settings = [])
{
$this->version = $version;
$this->author = $author;
$this->fields = $settings;
- 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 $english_path is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $plugin_name is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $plugin_name is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $t_course is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $language_interface is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $t_course is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $language_interface is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $plugin_name is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $plugin_name is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $t_course is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $english_path is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $language_interface is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $language_interface is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $language_interface is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 $language_files is not named in camelCase. Open
protected function __construct($version, $author, $settings = [])
{
$this->version = $version;
$this->author = $author;
$this->fields = $settings;
- 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 $t_course is not named in camelCase. Open
public function uninstall_course_fields($courseId)
{
$courseId = (int) $courseId;
if (empty($courseId)) {
- 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 $t_tool is not named in camelCase. Open
public function uninstall_course_fields($courseId)
{
$courseId = (int) $courseId;
if (empty($courseId)) {
- 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_tool_link is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $t_course is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $plugin_name is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $t_tool is not named in camelCase. Open
public function uninstall_course_fields($courseId)
{
$courseId = (int) $courseId;
if (empty($courseId)) {
- 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 $plugin_name is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 $t_course is not named in camelCase. Open
public function uninstall_course_fields($courseId)
{
$courseId = (int) $courseId;
if (empty($courseId)) {
- 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_tool_link is not named in camelCase. Open
public function install_course_fields_in_all_courses($add_tool_link = true)
{
// Update existing courses to add plugin settings
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id FROM $table ORDER BY 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 method get_lang is not named in camelCase. Open
public function get_lang($name)
{
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
- 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 course_install is not named in camelCase. Open
public function course_install($courseId, $addToolLink = true)
{
$this->install_course_fields($courseId, $addToolLink);
}
- 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_version is not named in camelCase. Open
public function get_version()
{
return $this->version;
}
- 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_settings is not named in camelCase. Open
public function get_settings($forceFromDB = false)
{
if (empty($this->settings) || $forceFromDB) {
$settings = api_get_settings_params(
[
- 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_comment is not named in camelCase. Open
public function get_comment()
{
return $this->get_lang('plugin_comment');
}
- 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_author is not named in camelCase. Open
public function get_author()
{
return $this->author;
}
- 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_title is not named in camelCase. Open
public function get_title()
{
return $this->get_lang('plugin_title');
}
- 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_name is not named in camelCase. Open
public function get_name()
{
$result = get_class($this);
$result = str_replace('Plugin', '', $result);
$result = strtolower($result);
- 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_css is not named in camelCase. Open
public function get_css()
{
$name = $this->get_name();
$path = api_get_path(SYS_PLUGIN_PATH)."$name/resources/$name.css";
if (!is_readable($path)) {
- 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_lang_plugin_exists is not named in camelCase. Open
public function get_lang_plugin_exists($name)
{
return isset($this->strings[$name]);
}
- 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_info is not named in camelCase. Open
public function get_info()
{
$result = [];
$result['obj'] = $this;
$result['title'] = $this->get_title();
- 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 install_course_fields_in_all_courses is not named in camelCase. Open
public function install_course_fields_in_all_courses($add_tool_link = true)
{
// Update existing courses to add plugin settings
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id FROM $table ORDER BY 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() {
}
}
Source
The method install_course_fields is not named in camelCase. Open
public function install_course_fields($courseId, $add_tool_link = true)
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
$courseId = (int) $courseId;
- 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 uninstall_course_fields is not named in camelCase. Open
public function uninstall_course_fields($courseId)
{
$courseId = (int) $courseId;
if (empty($courseId)) {
- 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 uninstall_course_fields_in_all_courses is not named in camelCase. Open
public function uninstall_course_fields_in_all_courses()
{
// Update existing courses to add conference settings
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id FROM $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 course_settings_updated is not named in camelCase. Open
public function course_settings_updated($values = [])
{
}
- 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() {
}
}