jidaikobo-shibata/a11yc

View on GitHub

Showing 426 of 426 total issues

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

    private static function getInput($n, $str, $retvals)
    {
        $force = true;
        $ms = Element\Get::elementsByRe($str, 'ignores', 'tags', $force);

Severity: Minor
Found in classes/Image.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 setCommonIssue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private static function setCommonIssue($issues, $commons)
    {
        foreach ($commons as $v)
        {
            foreach ($v as $vv)
Severity: Minor
Found in classes/Model/Issue.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 importIssue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

        foreach ($results['issue'] as $url => $vals)
Severity: Minor
Found in classes/Controller/DataImport.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

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

    public static function makeArray($css)
    {
        // remove comments, import or so
        $css = preg_replace('/\/\*.+?\*\//is', '', $css);
        $css = preg_replace('/^@import.+?$/mis', '', $css);
Severity: Minor
Found in classes/Model/CssFormat.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

Method check has 27 lines of code (exceeds 25 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

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

      Method check has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function check($url)
          {
              Validate\Set::log($url, 'too_much_opens', self::$unspec, 1);
              Validate\Set::log($url, 'too_much_ends', self::$unspec, 1);
              Validate\Set::log($url, 'suspicious_ends', self::$unspec, 1);
      Severity: Minor
      Found in classes/Validate/Check/SuspiciousElements.php - About 1 hr to fix

        Method check has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function check($url)
            {
                Validate\Set::log($url, 'empty_link_element', self::$unspec, 1);
                $str = Element\Get::ignoredHtml($url);
        
        
        Severity: Minor
        Found in classes/Validate/Check/EmptyLinkElement.php - About 1 hr to fix

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

              public static function edit()
              {
                  $url_path = base64_encode(Input::get('url'));
                  $url = Util::urldec(Input::get('url'));
          
          
          Severity: Minor
          Found in classes/Controller/PageUpdate.php - About 1 hr to fix

            Method divideEachProperties has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function divideEachProperties($each_properties)
                {
                    $props = array();
                    foreach ($each_properties as $prop_and_val)
                    {
            Severity: Minor
            Found in classes/Model/CssFormat.php - About 1 hr to fix

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

                  public static function fetchAll($force = false)
                  {
                      if ( ! is_null(static::$vals) && ! $force) return static::$vals;
                      $vals = array();
                      $commons = array();
              Severity: Minor
              Found in classes/Model/Issue.php - About 1 hr to fix

                Method routing has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function routing()
                    {
                        // vals
                        $a = Input::get('a', '');
                        $controller = '\A11yc\Controller\Post';
                Severity: Minor
                Found in classes/Controller/Post.php - About 1 hr to fix

                  Method updateChecks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static function updateChecks($url)
                      {
                          $bulk = Input::postArr('chk');
                          $vals = array();
                          $loops = array(
                  Severity: Minor
                  Found in classes/Controller/Bulk.php - About 1 hr to fix

                    Method filter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function filter($vals, $fields)
                        {
                            foreach ($fields as $k => $v)
                            {
                                $vals[$k] = Arr::get($vals, $k, $v);
                    Severity: Minor
                    Found in classes/Model/DataFilter.php - About 1 hr to fix

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

                          public static function report($base_url, $is_index = false)
                          {
                              $settings = Model\Setting::fetchAll();
                              View::assign('title', A11YC_LANG_POLICY);
                      
                      
                      Severity: Minor
                      Found in classes/Controller/ResultReport.php - About 1 hr to fix

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

                          Method getCssFileFromLink has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private static function getCssFileFromLink($html, $ua)
                              {
                                  $css = '';
                                  $ua = $ua == 'using' ? Input::userAgent() : $ua;
                                  if (preg_match_all("/\<link [^\>]*\>/si", $html, $ms))
                          Severity: Minor
                          Found in classes/Model/Css.php - About 1 hr to fix

                            Method uas has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function uas()
                                {
                                    return array(
                                        'using' => array(
                                            'name' => A11YC_LANG_UA_USING,
                            Severity: Minor
                            Found in classes/Values.php - About 1 hr to fix

                              Method set has 26 lines of code (exceeds 25 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
                                Severity
                                Category
                                Status
                                Source
                                Language