jidaikobo-shibata/a11yc

View on GitHub

Showing 280 of 426 total issues

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

    public static function fetchArr($key, $url = '*', $default = array(), $force = false, $version = null, $group_id = null)
Severity: Minor
Found in classes/Model/DataFetch.php - About 45 mins to fix

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

        public static function enuniqueUri($uri, $base_uri = '')
        {
            if (empty($uri)) return '';
            $base_url = $base_uri ?: Model\Data::baseUrl();
    
    
    Severity: Minor
    Found in classes/Util.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 updateIssues has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function updateIssues()
        {
            $sql = 'SELECT `version` FROM '.A11YC_TABLE_ISSUES.' GROUP BY `version`;';
            $versions = self::versionArray(Db::fetchAll($sql));
    
    
    Severity: Minor
    Found in classes/Update/AddData.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 importChecklist has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function importChecklist($results)
        {
            if ( ! isset($results['check'])) return;
    
            foreach ($results['check'] as $url => $vals)
    Severity: Minor
    Found in classes/Controller/DataImport.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 addEachIclAndCriterion has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function addEachIclAndCriterion($zip, $urls)
        {
            $n =1;
            $exist = false;
            foreach ($urls as $url)
    Severity: Minor
    Found in classes/Controller/DownloadReport.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 decompose has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function decompose($text)
        {
            $rets = array();
    
            // icl table
    Severity: Minor
    Found in classes/Controller/Test.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 filterSearch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function filterSearch($pages, $words)
        {
            if (empty($words)) return $pages;
            $vals = array();
            foreach ($pages as $page)
    Severity: Minor
    Found in classes/Model/Page.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 fetchOne has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function fetchOne($key, $url = '*', $default = '', $force = false, $version = null, $group_id = null)
    Severity: Minor
    Found in classes/Model/DataFetch.php - About 45 mins to fix

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

          public static function fetch($key, $url = '*', $default = array(), $force = false, $version = null, $group_id = null)
      Severity: Minor
      Found in classes/Model/DataFetch.php - About 45 mins to fix

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

            private static function updateResults($url)
            {
                $bulk = Input::postArr('results');
                $vals = array();
                $current = Model\Result::fetch($url);
        Severity: Minor
        Found in classes/Controller/Bulk.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 updateChecklist has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function updateChecklist($url)
            {
                $techs = Yaml::each('techs');
                $sql = 'SELECT `version` FROM '.A11YC_TABLE_CHECKS.' WHERE `url` = ? GROUP BY `version`;';
                $versions = self::versionArray(Db::fetchAll($sql, array($url)));
        Severity: Minor
        Found in classes/Update/AddData.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 techVals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function techVals($vals)
            {
                if (isset($vals['tech_url']) && ! empty($vals['tech_url']))
                {
                    $techs = array();
        Severity: Minor
        Found in classes/Update/AddData.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 tidyAlt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function tidyAlt($k, $v, $retvals)
            {
                if (isset($v['attrs']['alt']))
                {
                    // empty alt
        Severity: Minor
        Found in classes/Image.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

        Consider simplifying this complex logical expression.
        Open

                if (strlen($uri) >= 2 && $uri[0] == '/' && $uri[1] != '/')
                {
                    $uri = $base_url.$uri;
                }
                // started with "./"
        Severity: Major
        Found in classes/Util.php - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if (strlen($url) >= 2 && $url[0] == '.' && $url[1] == '/')
                      {
                          $url = $css_url.substr($url, 1);
                      }
                      // started with "../"
          Severity: Major
          Found in classes/Model/Css.php - About 40 mins to fix

            Method getText has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static function getText($url, $code_str, $place, $key, $num_of_err)
            Severity: Minor
            Found in classes/Message.php - About 35 mins to fix

              Method duplicatedNames has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  private static function duplicatedNames($k, $url, $whole_form, $v, $action)
              Severity: Minor
              Found in classes/Validate/Check/FormAndLabels.php - About 35 mins to fix

                Method addErrorToHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $url,
                        $error_id,
                        $s_errors,
                        $ignore_vals = '',
                        $issue_html = ''
                Severity: Minor
                Found in classes/Validate.php - About 35 mins to fix

                  Method replaceSafeStrings has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private static function replaceSafeStrings($replaces, $k, $lv, $error_id, $current_err)
                  Severity: Minor
                  Found in classes/Validate.php - About 35 mins to fix

                    Method error has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static function error($url, $error_name, $count, $id, $str)
                    Severity: Minor
                    Found in classes/Validate/Set.php - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language