TianLiangZhou/shrimp-wechat-sdk

View on GitHub

Showing 24 of 26 total issues

Method decrypt has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $cipherText,
        string $key,
        string $iv = '',
        int $option = OPENSSL_RAW_DATA,
        $method = null
Severity: Minor
Found in src/Support/Aes.php - About 35 mins to fix

    Method build has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $data,
            $root = 'xml',
            $item = 'item',
            $attr = '',
            $id = 'id'
    Severity: Minor
    Found in src/Support/Xml.php - About 35 mins to fix

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

          public function create(string $type, array $baseInfo, $exclusive, array $advanceInfo = [])
          {
              $uri = $this->format('card/create');
              $property = [
                  'base_info' => $baseInfo,
      Severity: Minor
      Found in src/Api/Card.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 addFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function addFile(array $files)
          {
              $keys = array_keys($files);
              if (!is_array($files[$keys[0]])) {
                  $files = [$files];
      Severity: Minor
      Found in src/File/MediaFile.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