jidaikobo-shibata/a11yc

View on GitHub

Showing 280 of 426 total issues

Function getReversedValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getReversedValue($results)
    {
        $results2 = array();
        foreach ($results as $k => $v)
        {
Severity: Minor
Found in classes/Controller/Tech.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 trashControl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function trashControl($act)
    {
        $id = intval(Input::get('id'));
        $item = Model\Icl::fetch($id);
        if (empty($item)) Util::error('Icl not found');
Severity: Minor
Found in classes/Controller/Icl.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 trashControl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function trashControl($act)
    {
        $id = intval(Input::get('id'));
        $item = Model\Issue::fetch($id);
        if (empty($item)) Util::error('issue not found');
Severity: Minor
Found in classes/Controller/IssueUpdate.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 passed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function passed($cs, $yml)
    {
        $passed = array();
        foreach ($yml['passes'] as $code => $codes)
        {
Severity: Minor
Found in classes/Update/One2Two.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 key2link has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function key2link($text, $doc_url = '')
    {
        preg_match_all("/\[[^\]]+?\]/", $text, $ms);

        if ( ! $ms[0]) return $text;
Severity: Minor
Found in classes/Util.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 criterionsOfLevels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function criterionsOfLevels()
    {
        $yml = Yaml::fetch();
        // levels
        $levels = array();
Severity: Minor
Found in classes/Util.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 method.
Open

        return true;
Severity: Major
Found in classes/Guzzle.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return '';
    Severity: Major
    Found in classes/Validate/Check/LinkCheck.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return false;
      Severity: Major
      Found in classes/Element.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $array;
        Severity: Major
        Found in libs/kontiki/classes/Arr.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return true;
          Severity: Major
          Found in classes/Guzzle.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return static::value($default);
            Severity: Major
            Found in libs/kontiki/classes/Arr.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return static::$langs[$url];
              Severity: Major
              Found in classes/Element/Get/Each.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return false;
                Severity: Major
                Found in classes/Controller/PageAdd.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return true;
                  Severity: Major
                  Found in classes/Controller/PageAdd.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return false;
                    Severity: Major
                    Found in classes/Controller/PageAdd.php - About 30 mins to fix

                      Function targetCriterions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function targetCriterions()
                          {
                              $retvals = array();
                              $target_level = (int) Model\Setting::fetch('target_level');
                              if (empty($target_level)) return $retvals;
                      Severity: Minor
                      Found in classes/Values.php - About 25 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 html has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function html($url, $html, $codes = array(), $ua = 'using', $force = false)
                          {
                      //        if ( ! is_string($html)) Util::error('invalid HTML was given');
                              $html = ! is_string($html) ? '' : $html;
                      
                      
                      Severity: Minor
                      Found in classes/Validate.php - About 25 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 resultStr has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function resultStr($level, $target_level, $is_str = TRUE)
                          {
                              $level = intval($level);
                              if ($target_level == 2 && $level == 1)
                              {
                      Severity: Minor
                      Found in classes/Evaluate.php - About 25 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 garbageCollection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static function garbageCollection ($path)
                          {
                              $path = dirname($path);
                              foreach (glob($path.'/'.'*') as $file)
                              {
                      Severity: Minor
                      Found in libs/kontiki/classes/Maintenance.php - About 25 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

                      Severity
                      Category
                      Status
                      Source
                      Language