Showing 216 of 1,940 total issues
Function indexOf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
i || (i = 0);
var length = this.length;
if (i < 0) i = length + i;
for (; i < length; i++)
- 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 test_case_all_func
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function test_case_all_func()
{
$functions = get_defined_functions();
$functions = $functions['user'];
$tests = array();
- 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 file_mime_content_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function file_mime_content_type($filename)
{
$ext = file_extension($filename); /* strtolower isn't necessary */
if($mime = mime_type($ext)) return $mime;
elseif (function_exists('finfo_open'))
- 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 file_list_dir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function file_list_dir($dir)
{
$files = array();
if ($handle = opendir($dir))
{
- 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 params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function params($name_or_array_or_null = null, $value = null)
{
static $params = array();
$args = func_get_args();
- 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
Avoid too many return
statements within this function. Open
return [];
Avoid too many return
statements within this function. Open
return new BoundingBox (se.Latitude/60, nw.Longitude/60,
nw.Latitude/60, se.Longitude/60 );
Avoid too many return
statements within this function. Open
return new MQA.BoundingBox(se.lat, nw.lon, nw.lat, se.lon);
Avoid too many return
statements within this function. Open
return new BoundingBox(se.Latitude,nw.Longitude,nw.Latitude,se.Longitude);
Avoid too many return
statements within this function. Open
return [targetNode];
Avoid too many return
statements within this function. Open
if (node == targetNode) return [targetNode];
Avoid too many return
statements within this function. Open
return map.getMapScale();
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
Avoid too many return
statements within this function. Open
return new BoundingBox(ybox.LatMin, ybox.LonMin, ybox.LatMax, ybox.LonMax);
Avoid too many return
statements within this function. Open
return Math.round(zoom);
Avoid too many return
statements within this function. Open
return new BoundingBox(sw.lat, sw.lon, ne.lat, ne.lon);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $messages;
Avoid too many return
statements within this method. Open
return 'Dojo Address: Must be alphanumeric or a comma, or fullstop only';