jidaikobo-shibata/a11yc

View on GitHub

Showing 280 of 426 total issues

Function get has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function get($array, $key, $default = null)
    {
        if ( ! is_array($array) and ! $array instanceof \ArrayAccess)
        {
//            throw new \InvalidArgumentException('First parameter must be an array or ArrayAccess object.');
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 duplicatedNames has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static function duplicatedNames($k, $url, $whole_form, $v, $action)
    {
        preg_match_all("/\<(?:input|select|textarea) .+?\>/si", $whole_form, $names);
        if (isset($names[0]))
        {
Severity: Minor
Found in classes/Validate/Check/FormAndLabels.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 12 (exceeds 5 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

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 setDeleteElement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static function setDeleteElement($eles, $fors)
    {
        $del_eles = array();
        foreach ($fors as $for)
        {
Severity: Minor
Found in classes/Validate/Check/NotLabelButTitle.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 updateChecks has a Cognitive Complexity of 12 (exceeds 5 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

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 fetchAll has a Cognitive Complexity of 12 (exceeds 5 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

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 issue has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function issue($users = array(), $current_user_id = NULL, $is_admin = false)
    {
        $id = intval(Input::get('id'));
        $issue = Model\Issue::fetch($id);
        if (empty($issue) || Arr::get($issue, 'trash') == 1) Util::error('issue not found');
Severity: Minor
Found in classes/Controller/IssueRead.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 forge has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function forge($controller = '\A11yc\Controller\Center', $action = 'actionIndex')
    {
        // vals
        $c = Input::get('c', '');
        $a = Input::get('a', '');
Severity: Minor
Found in classes/Route.php - About 1 hr to fix

    Method collectFormItems has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static function collectFormItems($ms)
        {
            $form_items = array('<form ', '</form' ,'<label', '<input', '<select', '<texta', '<butto');
            $forms = array();
            $n = 0;
    Severity: Minor
    Found in classes/Validate/Check/FormAndLabels.php - About 1 hr to fix

      Method get has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function get()
          {
              // don't call twice
              if (isset($this->body) && $this->body) return true;
              $url = $this->url;
      Severity: Minor
      Found in classes/Guzzle.php - About 1 hr to fix

        Method get has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function get($array, $key, $default = null)
            {
                if ( ! is_array($array) and ! $array instanceof \ArrayAccess)
                {
        //            throw new \InvalidArgumentException('First parameter must be an array or ArrayAccess object.');
        Severity: Minor
        Found in libs/kontiki/classes/Arr.php - About 1 hr to fix

          Method uniqueLabel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static function uniqueLabel($k, $url, $whole_form, $v)
              {
                  preg_match_all("/\<label[^\>]*?\>(.+?)\<\/label\>/is", $whole_form, $ms);
          
                  if (isset($ms[1]))
          Severity: Minor
          Found in classes/Validate/Check/FormAndLabels.php - About 1 hr to fix

            Method update has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function update()
                {
                    if ( ! Db::isTableExist(A11YC_TABLE_SETTINGS)) return;
            
                    self::serialize2json(); // trait AddDataUtil
            Severity: Minor
            Found in classes/Update/AddData.php - About 1 hr to fix

              Method index has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function index()
                  {
                      // fetch pages
                      $list  = Input::get('list', 'all');
                      $words = Util::searchWords2Arr(Input::get('s', ''));
              Severity: Minor
              Found in classes/Controller/PageIndex.php - About 1 hr to fix

                Method issue has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function issue()
                    {
                        $issues = Model\Issue::fetchByStatus(0);
                        $settings = Model\Setting::fetchAll();
                        $pages = Model\Page::fetchAll();
                Severity: Minor
                Found in classes/Controller/DownloadIssue.php - About 1 hr to fix

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

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

                    Function a11yc_tooltip has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function a11yc_tooltip(){
                    //    console.log('function:'+'a11yc_tooltip');
                            var $a11yc_tooltip = $(),
                                    title_str = '',
                                    position = 0,
                    Severity: Minor
                    Found in public/assets/js/a11yc.js - About 1 hr to fix

                      Method setLabelAndElement has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static function setLabelAndElement($ms)
                          {
                              $eles = array();
                              $fors = array();
                      
                      
                      Severity: Minor
                      Found in classes/Validate/Check/NotLabelButTitle.php - About 1 hr to fix

                        Method __construct has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __construct($config)
                            {
                                $dbtype = strtolower($config['dbtype']);
                                $dbh = false;
                        
                        
                        Severity: Minor
                        Found in libs/kontiki/classes/Db.php - About 1 hr to fix

                          Method validate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private static function validate($url, $target_html, $ua, $do_css_check = false)
                              {
                                  // check
                                  $codes = Validate::$codes;
                                  Validate::$do_css_check = $do_css_check;
                          Severity: Minor
                          Found in classes/Controller/Post.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language