jidaikobo-shibata/a11yc

View on GitHub

Showing 280 of 426 total issues

Function importPage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static function importPage($results)
    {
        if ( ! isset($results['page'])) return;

        $this_pages = Model\Page::fetchAll();
Severity: Minor
Found in classes/Controller/DataImport.php - About 55 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 enuniqueCssUri has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static function enuniqueCssUri($url, $css_url = '')
    {
        if ($css_url)
        {
            $css_urls = explode('/', $css_url);
Severity: Minor
Found in classes/Model/Css.php - About 55 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

Method dt has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private static function dt($url, $code_str, $place, $key, $current_err, $lv, $num_of_err)
Severity: Major
Found in classes/Message.php - About 50 mins to fix

    Method submitless has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private static function submitless($n, $url, $v, $action, $uniqued_types, $uniqued_eles)
    Severity: Minor
    Found in classes/Validate/Check/FormAndLabels.php - About 45 mins to fix

      Function check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function check($url, $regex)
          {
              if (A11YC_DB_TYPE == 'none') return;
      
              $str = Element\Get::ignoredHtml($url);
      Severity: Minor
      Found in classes/Validate/Check/Issues/Base.php - About 45 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 check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function check($url)
          {
              Validate\Set::log($url, 'alt_attr_of_img', self::$unspec, 1);
              $str = Element\Get::ignoredHtml($url);
              $ms = Element\Get::elementsByRe($str, 'ignores', 'imgs');
      Severity: Minor
      Found in classes/Validate/Check/AltAttrOfImg.php - About 45 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 check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function check($url)
          {
              $error_names = array(
                  'labelless',
                  'submitless',
      Severity: Minor
      Found in classes/Validate/Check/FormAndLabels.php - About 45 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 isIgnorable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function isIgnorable($str)
          {
              $attrs = Element\Get::attributes($str);
      
              // Strictly this is not so correct. but it seems be considered.
      Severity: Minor
      Found in classes/Element.php - About 45 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 evaluateTotal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function evaluateTotal()
          {
              // fetch pages
              $args = array(
                  'list' => 'done',
      Severity: Minor
      Found in classes/Evaluate.php - About 45 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 check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function check($url)
          {
              Validate\Set::log($url, 'must_be_numeric_attr', self::$unspec, 1);
              $str = Element\Get::ignoredHtml($url);
              $ms = Element\Get::elementsByRe($str, 'ignores', 'tags');
      Severity: Minor
      Found in classes/Validate/Check/_Suppress/MustBeNumericAttr.php - About 45 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

      Method errorAndLog has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function errorAndLog($exp, $url, $error_name, $count, $id, $str)
      Severity: Minor
      Found in classes/Validate/Set.php - About 45 mins to fix

        Function isFisrtOfToday has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function isFisrtOfToday ()
            {
                if ( ! is_null(static::$is_first_of_day)) return static::$is_first_of_day;
        
                $today = date('Y-m-d');
        Severity: Minor
        Found in classes/Maintenance.php - About 45 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 sqlite has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function sqlite ($path, $file, $is_force = FALSE)
            {
                if (defined('A11YC_DB_TYPE') && A11YC_DB_TYPE == 'mysql') return;
        
                if ( ! file_exists($path.$file))
        Severity: Minor
        Found in libs/kontiki/classes/Maintenance.php - About 45 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 checkBgImageWithoutBgColor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function checkBgImageWithoutBgColor($url, $selector, $k, $props)
            {
                $is_exists_bg = false;
                if (
                    isset($props['background']) ||
        Severity: Minor
        Found in classes/Validate/Check/CssInvisibles.php - About 45 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 dt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function dt($url, $code_str, $place, $key, $current_err, $lv, $num_of_err)
            {
                if ( ! is_array($current_err)) Util::error('invalid value was given');
        
                $yml = Yaml::fetch();
        Severity: Minor
        Found in classes/Message.php - About 45 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

        Method base has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private static function base($value, $url, $codes, $ua, $force, $default = array())
        Severity: Minor
        Found in classes/Validate/Get.php - About 45 mins to fix

          Function actionImport has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function actionImport()
              {
                  $is_waic_imported = Model\Setting::fetch('is_waic_imported');
                  if ($is_waic_imported) Util::redirect(A11YC_URL);
          
          
          Severity: Minor
          Found in classes/Controller/Icl.php - About 45 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 removeViewSrc has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private static function removeViewSrc($html, $messages, $show_link_to_issue)
              {
                  foreach($messages as $k => $message)
                  {
                      if (isset($message['dt']))
          Severity: Minor
          Found in classes/Message/Plugin.php - About 45 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 fetch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function fetch($key, $url = '*', $default = array(), $force = false, $version = null, $group_id = null)
              {
                  $vals = self::fetchAll($force, $version, $group_id);
          
                  if ($key == 'global')
          Severity: Minor
          Found in classes/Model/DataFetch.php - About 45 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 fetchPassed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function fetchPassed($url)
              {
                  $results = self::fetch($url, true);
                  if ( ! is_array($results)) return array();
                  $retval = array();
          Severity: Minor
          Found in classes/Model/Result.php - About 45 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