lancew/DojoList

View on GitHub

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++)
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

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();
Severity: Minor
Found in lib/limonade/tests.php - About 35 mins to fix

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'))
Severity: Minor
Found in lib/limonade.php - About 35 mins to fix

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))
  {
Severity: Minor
Found in lib/limonade.php - About 35 mins to fix

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();

Severity: Minor
Found in lib/limonade.php - About 35 mins to fix

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 [];
Severity: Major
Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return new BoundingBox (se.Latitude/60, nw.Longitude/60,
                    nw.Latitude/60, se.Longitude/60 );
    Severity: Major
    Found in js/mapstraction.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return new MQA.BoundingBox(se.lat, nw.lon, nw.lat, se.lon);
      Severity: Major
      Found in js/mapstraction.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return new BoundingBox(se.Latitude,nw.Longitude,nw.Latitude,se.Longitude);
        Severity: Major
        Found in js/mapstraction.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return [targetNode];
          Severity: Major
          Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                      if (node == targetNode) return [targetNode];
            Severity: Major
            Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return map.getMapScale();
              Severity: Major
              Found in js/mapstraction.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return value;
                Severity: Major
                Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
                  Severity: Major
                  Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return new BoundingBox(ybox.LatMin, ybox.LonMin, ybox.LatMax, ybox.LonMax);
                    Severity: Major
                    Found in js/mapstraction.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return Math.round(zoom);
                      Severity: Major
                      Found in js/mapstraction.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return new BoundingBox(sw.lat, sw.lon, ne.lat, ne.lon);
                        Severity: Major
                        Found in js/mapstraction.js - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return null;
                          Severity: Major
                          Found in lib/data.model.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                              return $messages;
                            Severity: Major
                            Found in lib/limonade.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return 'Dojo Address: Must be alphanumeric or a comma, or fullstop only';
                              Severity: Major
                              Found in lib/data.model.php - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language