class/Form.php
Method job
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$class,
$name,
$name2,
$rel,
$textmore,
Method school_add
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$class,
$name,
$name2,
$rel,
array $options,
Method usersettings
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function usersettings($userid)
{
$form = "<div style='display:none'><div class='smallworld_usersetings'>";
$form .= '<fieldset><legend>' . _SMALLWORLD_SHOWIFPUBLICORPRIVATE . '</legend>';
$form .= "<form id='perset'>";
Method dropdown_add
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function dropdown_add($class, $name, $name2, $rel, array $options, $textmore, $selected = null, $preset = null)
Method input_add
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function input_add($class, $name, $name2, $rel, $size, $textmore, $preset = null, $id = null)
Method textarea
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function textarea($name, $id, $title, $rows, $cols, $class, $preset = null)
Function usersettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function usersettings($userid)
{
$form = "<div style='display:none'><div class='smallworld_usersetings'>";
$form .= '<fieldset><legend>' . _SMALLWORLD_SHOWIFPUBLICORPRIVATE . '</legend>';
$form .= "<form id='perset'>";
- 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
Method input
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function input($name, $id, $class, $size = null, $preset = null)
Method retrieveRadio
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function retrieveRadio($name, $options, $valuearray, $selected = null, $sep = '<br>')