helpscout/specter-php

View on GitHub

Showing 5 of 12 total issues

Function substituteMockData has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

public function substituteMockData(array $fixture)
{
foreach ($fixture as $jsonKey => $jsonValue) {
// Recurse into a json structure.
if (is_array($jsonValue)) {
Severity: Minor
Found in src/Specter.php - About 3 hrs to fix

Method substituteMockData has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function substituteMockData(array $fixture)
{
foreach ($fixture as $jsonKey => $jsonValue) {
// Recurse into a json structure.
if (is_array($jsonValue)) {
Severity: Minor
Found in src/Specter.php - About 2 hrs to fix

    Method assertResponseContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    static public function assertResponseContent(
    ResponseInterface $response,
    $filename,
    $mimeType = 'json'
    ) {
    Severity: Minor
    Found in src/Testing/SpecterTestTrait.php - About 1 hr to fix

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

      static private function getMatcherFormat(array $spec)
      {
      foreach ($spec as $jsonKey => $jsonValue) {
      // Recurse into a json structure.
      if (is_array($jsonValue)) {
      Severity: Minor
      Found in src/Testing/SpecterTestTrait.php - About 35 mins to fix

      Avoid too many return statements within this method.
      Open

      return $relatedToValue;
      Severity: Major
      Found in src/Provider/RelatedElement.php - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language