helpscout/specter-php

View on GitHub
src/Specter.php

Summary

Maintainability
B
5 hrs
Test Coverage

Showing 5 of 5 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

    The method substituteMockData() has an NPath complexity of 217. The configured NPath complexity threshold is 200.
    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 by phpmd

    The method substituteMockData() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
    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 by phpmd

    Avoid using static access to class '\Faker\Factory' in method '__construct'.
    Open

    $this->faker = Faker\Factory::create();
    Severity: Minor
    Found in src/Specter.php by phpmd
    Category
    Status