jidaikobo-shibata/a11yc

View on GitHub

Showing 426 of 426 total issues

Function html has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function html()
    {
        if (class_exists('ZipArchive'))
        {
            if (ini_get('zlib.output_compression'))
Severity: Minor
Found in classes/Controller/DownloadHtml.php - About 35 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 getReversedValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getReversedValue($results)
    {
        $results2 = array();
        foreach ($results as $k => $v)
        {
Severity: Minor
Found in classes/Controller/Tech.php - About 35 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 trashControl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function trashControl($act)
    {
        $id = intval(Input::get('id'));
        $item = Model\Icl::fetch($id);
        if (empty($item)) Util::error('Icl not found');
Severity: Minor
Found in classes/Controller/Icl.php - About 35 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 trashControl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function trashControl($act)
    {
        $id = intval(Input::get('id'));
        $item = Model\Issue::fetch($id);
        if (empty($item)) Util::error('issue not found');
Severity: Minor
Found in classes/Controller/IssueUpdate.php - About 35 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 passed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function passed($cs, $yml)
    {
        $passed = array();
        foreach ($yml['passes'] as $code => $codes)
        {
Severity: Minor
Found in classes/Update/One2Two.php - About 35 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 key2link has a Cognitive Complexity of 7 (exceeds 5 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 35 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 criterionsOfLevels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function criterionsOfLevels()
    {
        $yml = Yaml::fetch();
        // levels
        $levels = array();
Severity: Minor
Found in classes/Util.php - About 35 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

Avoid too many return statements within this method.
Open

        return true;
Severity: Major
Found in classes/Guzzle.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return '';
    Severity: Major
    Found in classes/Validate/Check/LinkCheck.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return false;
      Severity: Major
      Found in classes/Element.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $array;
        Severity: Major
        Found in libs/kontiki/classes/Arr.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return true;
          Severity: Major
          Found in classes/Guzzle.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return static::value($default);
            Severity: Major
            Found in libs/kontiki/classes/Arr.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return static::$langs[$url];
              Severity: Major
              Found in classes/Element/Get/Each.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return false;
                Severity: Major
                Found in classes/Controller/PageAdd.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return true;
                  Severity: Major
                  Found in classes/Controller/PageAdd.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return false;
                    Severity: Major
                    Found in classes/Controller/PageAdd.php - About 30 mins to fix

                      Missing class import via use statement (line '175', column '17').
                      Open

                              $client = new \GuzzleHttp\Client(array(
                      Severity: Minor
                      Found in classes/Guzzle.php by phpmd

                      MissingImport

                      Since: 2.7.0

                      Importing all external classes in a file through use statements makes them clearly visible.

                      Example

                      function make() {
                          return new \stdClass();
                      }

                      Source http://phpmd.org/rules/cleancode.html#MissingImport

                      Remove error control operator '@' on line 102.
                      Open

                          public static function getLatestVersion ()
                          {
                              if ( ! self::isFisrtOfToday()) return false;
                              if ( ! is_null(self::$latest_version)) return self::$latest_version;
                      
                      
                      Severity: Minor
                      Found in classes/Maintenance.php by phpmd

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      Missing class import via use statement (line '84', column '16').
                      Open

                                      $dbh = new \PDO($dtbs, $config['user'], $config['password']);
                      Severity: Minor
                      Found in libs/kontiki/classes/Db.php by phpmd

                      MissingImport

                      Since: 2.7.0

                      Importing all external classes in a file through use statements makes them clearly visible.

                      Example

                      function make() {
                          return new \stdClass();
                      }

                      Source http://phpmd.org/rules/cleancode.html#MissingImport

                      Severity
                      Category
                      Status
                      Source
                      Language