jidaikobo-shibata/a11yc

View on GitHub

Showing 280 of 426 total issues

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

    public static function check($url)
    {
        Validate\Set::log($url, 'style_for_structure', self::$unspec, 1);
        $str = Element\Get::ignoredHtml($url);

Severity: Minor
Found in classes/Validate/Check/StyleForStructure.php - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function check($url)
    {
        Validate\Set::log($url, 'titleless_frame', self::$unspec, 1);

        $str = Element\Get::ignoredHtml($url);
Severity: Minor
Found in classes/Validate/Check/TitlelessFrame.php - About 25 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 existCheck has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function existCheck($href)
    {
        $len = '';
        $is_exists = null;
        if (\A11yc\Guzzle::envCheck())
Severity: Minor
Found in classes/Validate/Check/TellUserFileType.php - About 25 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 byte2Str has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function byte2Str($bytes)
    {
        if ( ! is_numeric($bytes)) return $bytes;

        if ($bytes >= 1073741824)
Severity: Minor
Found in libs/kontiki/classes/Util.php - About 25 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 filteredSelectionReasons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function filteredSelectionReasons()
    {
        $selection_reasons = Values::selectionReasons();

        switch (Arr::get(Model\Setting::fetchAll(), 'selected_method'))
Severity: Minor
Found in classes/Values.php - About 25 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 index has a Cognitive Complexity of 6 (exceeds 5 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 25 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 each has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function each($url, $base_url = '', $is_assign = false, $is_center = false)
    {
        $page = Model\Page::fetch($url);

        if ( ! $page || ! $page['done'] || $page['trash'])
Severity: Minor
Found in classes/Controller/ResultEach.php - About 25 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 getButton has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getButton($n, $str, $retvals)
    {
        preg_match_all('/\<button [^\>]+\>.+?\<\/button\>/is', $str, $as);
        foreach ($as[0] as $v)
        {
Severity: Minor
Found in classes/Image.php - About 25 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 routing has a Cognitive Complexity of 6 (exceeds 5 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 25 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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function update()
    {
        if (A11YC_DB_TYPE != 'mysql') return;
        $sql = 'SHOW COLUMNS FROM '.A11YC_TABLE_DATA.';';
        foreach (Db::fetchAll($sql) as $v)
Severity: Minor
Found in classes/Update/UpdateMysqlValueField.php - About 25 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 imagesInA has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function imagesInA($n, $str, $retvals)
    {
        preg_match_all('/\<a [^\>]+\>.+?\<\/a\>/is', $str, $as);
        foreach ($as[0] as $v)
        {
Severity: Minor
Found in classes/Image.php - About 25 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 fetchTree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fetchTree($is_all = false, $force = false)
    {
        if ( ! is_null(static::$tree) && ! $force) return static::$tree;
        $vals = array();

Severity: Minor
Found in classes/Model/Icl.php - About 25 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 report has a Cognitive Complexity of 6 (exceeds 5 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 25 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 echoGetUrls has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function echoGetUrls($url, $urls, $base_url)
    {
        // already added
        if (in_array($url, $urls))
        {
Severity: Minor
Found in classes/Controller/PageAdd.php - About 25 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 updateUa has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function updateUa()
    {
        $names   = Input::postArr('name');
        $strs    = Input::postArr('str');
        $deletes = Input::postArr('delete');
Severity: Minor
Found in classes/Controller/Setting.php - About 25 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 criterion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function criterion()
    {
        // value check
        $criterions = Yaml::each('criterions');
        $criterion = Input::param('criterion', '');
Severity: Minor
Found in classes/Controller/BulkCriterion.php - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fetch($id, $force = false)
    {
        $vals = static::fetchAll($force);
        foreach ($vals as $val)
        {
Severity: Minor
Found in classes/Model/Issue.php - About 25 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 replaceErrorStrs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function replaceErrorStrs($html)
    {
        // remove "back" link
        $html = preg_replace(
            '/\<a href="#index_.+?a11yc_back_link.+?\<\/a\>/i',
Severity: Minor
Found in classes/Controller/Live.php - About 25 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 addNewSite has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function addNewSite($sites)
    {
        if ($new_site = Input::post('new_site', false))
        {
            if (in_array($new_site, $sites))
Severity: Minor
Found in classes/Controller/Setting.php - About 25 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 criterionDbio has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function criterionDbio($criterion)
    {
        $results = Input::postArr('results', NULL);
        $iclchks = Input::postArr('iclchks', NULL);
        $chk     = Input::postArr('chk', NULL);
Severity: Minor
Found in classes/Controller/BulkCriterion.php - About 25 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