helpscout/specter-php

View on GitHub
src/Testing/SpecterTestTrait.php

Summary

Maintainability
A
1 hr
Test Coverage

Showing 3 of 3 total issues

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 using static access to class '\Faker\Factory' in method 'assertResponseContent'.
    Open

    self::$faker = Faker\Factory::create();
    Severity: Minor
    Found in src/Testing/SpecterTestTrait.php by phpmd
    Category
    Status