jidaikobo-shibata/a11yc

View on GitHub

Showing 280 of 426 total issues

Method fetchAll has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function fetchAll($force = false, $version = null, $group_id = null)
    {
        if ( ! is_null(static::$vals) && ! $force) return static::$vals;
        $ret = static::fetchRaw($version, $group_id);

Severity: Minor
Found in classes/Model/DataFetch.php - About 1 hr to fix

    Method yml has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static function yml()
        {
            include A11YC_LIB_PATH.'/spyc/Spyc.php';
            if ( ! class_exists('Spyc')) Util::error('Spyc is not found');
            $chekcs_text = file_get_contents(__DIR__.'/resources/old_checks.yml');
    Severity: Minor
    Found in classes/Update/One2Two.php - About 1 hr to fix

      Method setDefault has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function setDefault()
          {
              // results
              Model\Setting::delete('bulk_results');
      
      
      Severity: Minor
      Found in classes/Controller/Bulk.php - About 1 hr to fix

        Method edit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function edit($is_add = false, $users = array(), $current_user_id = NULL)
            {
                $item = array();
                if ($id = intval(Input::get('id')))
                {
        Severity: Minor
        Found in classes/Controller/IssueUpdate.php - About 1 hr to fix

          Method fetch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function fetch()
              {
                  if ( ! empty(static::$data)) return static::$data;
          
                  // load Spyc - YAML lib.
          Severity: Minor
          Found in classes/Yaml.php - About 1 hr to fix

            Method doEvaluate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function doEvaluate($cs, $ngs, $yml)
                {
                    // passed
                    $passed = self::passed($cs, $yml);
            
            
            Severity: Minor
            Found in classes/Update/One2Two.php - About 1 hr to fix

              Method getText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getText($url, $code_str, $place, $key, $num_of_err)
                  {
                      $yml = Yaml::fetch();
              
                      $current_err = Validate::setCurrentErr($url, $code_str);
              Severity: Minor
              Found in classes/Message.php - About 1 hr to fix

                Method uploadImg has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function uploadImg($target_path, $id = '', $old_path = '')
                    {
                        $file = Input::file('file');
                        if (empty($file['name'])) return $old_path;
                
                
                Severity: Minor
                Found in classes/File.php - About 1 hr to fix

                  Method key2link has 28 lines of code (exceeds 25 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 1 hr to fix

                    Method failedOrDoOtherAction has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static function failedOrDoOtherAction($url, $doc_root, $target_html)
                        {
                            $do_validate = true;
                    
                            // basic auth failed
                    Severity: Minor
                    Found in classes/Controller/Post.php - About 1 hr to fix

                      Method report has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function report()
                          {
                              if (class_exists('ZipArchive'))
                              {
                                  if (ini_get('zlib.output_compression'))
                      Severity: Minor
                      Found in classes/Controller/DownloadReport.php - About 1 hr to fix

                        Function ignoreElementsOrComments has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function ignoreElementsOrComments($ignore_vals, $html)
                            {
                                $replaces_ignores = array();
                                if ($ignore_vals)
                                {
                        Severity: Minor
                        Found in classes/Validate.php - About 1 hr 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 removeQueryStrings has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function removeQueryStrings($uri, $query_strings = array())
                            {
                                if (strpos($uri, '?') !== false)
                                {
                                    // all query strings
                        Severity: Minor
                        Found in libs/kontiki/classes/Util.php - About 1 hr 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 doctype has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function doctype($url)
                            {
                                if (empty(Validate::$hl_htmls[$url])) return false;
                                $html = Validate::$hl_htmls[$url];
                        
                        
                        Severity: Minor
                        Found in classes/Element/Get/Each.php - About 1 hr 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 set has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function set(&$array, $key, $value = null)
                            {
                                if (is_null($key))
                                {
                                    $array = $value;
                        Severity: Minor
                        Found in libs/kontiki/classes/Arr.php - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
                        Open

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

                            public static function check()
                            {
                                $pages = array();
                                foreach (Model\Page::fetchAll() as $page)
                                {
                        Severity: Minor
                        Found in classes/Sitecheck/ContainWithoutAlt.php - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function check()
                            {
                                $pages = array();
                                foreach (Model\Page::fetchAll() as $page)
                                {
                        Severity: Minor
                        Found in classes/Sitecheck/ContainWithoutTh.php - About 1 hr 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 updateIcls has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function updateIcls($url)
                            {
                                $bulk = Input::postArr('iclchks');
                        
                                $vals = array();
                        Severity: Minor
                        Found in classes/Controller/Bulk.php - About 1 hr 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 getUrls has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function getUrls($url)
                            {
                                // fetch attributes
                                $ua   = 'using';
                                $html = Model\Html::fetch($url, $ua);
                        Severity: Minor
                        Found in classes/Controller/PageAdd.php - About 1 hr 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