soliantconsulting/SimpleFM

View on GitHub
src/Client/ResultSet/ResultSetClient.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

Showing 10 of 10 total issues

Method execute has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function execute(Command $command) : CollectionInterface
{
$xml = $this->connection->execute($command, self::GRAMMAR_PATH);
$errorCode = (int) $xml->error['code'];
$dataSource = $xml->datasource;
Severity: Minor
Found in src/Client/ResultSet/ResultSetClient.php - About 1 hr to fix

    Function execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    public function execute(Command $command) : CollectionInterface
    {
    $xml = $this->connection->execute($command, self::GRAMMAR_PATH);
    $errorCode = (int) $xml->error['code'];
    $dataSource = $xml->datasource;
    Severity: Minor
    Found in src/Client/ResultSet/ResultSetClient.php - About 25 mins to fix

    Function createRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    private function createRecord(SimpleXMLElement $recordData, array $metadata, int $prefixLength = 0) : array
    {
    $record = [
    'record-id' => (int) $recordData['record-id'],
    'mod-id' => (int) $recordData['mod-id'],
    Severity: Minor
    Found in src/Client/ResultSet/ResultSetClient.php - About 25 mins to fix

    Function parseRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    private function parseRecord(SimpleXMLElement $recordData, array $metadata) : array
    {
    $record = $this->createRecord($recordData, $metadata);
     
    if (isset($recordData->relatedset)) {
    Severity: Minor
    Found in src/Client/ResultSet/ResultSetClient.php - About 25 mins to fix

    The class ResultSetClient has a coupling between objects value of 17. Consider to reduce the number of dependencies under 13.
    Open

    final class ResultSetClient implements ResultSetClientInterface
    {
    const GRAMMAR_PATH = '/fmi/xml/fmresultset.xml';
     
    /**

    Avoid using static access to class '\Soliant\SimpleFM\Client\Exception\FileMakerException' in method 'execute'.
    Open

    throw FileMakerException::fromErrorCode($errorCode);

    Avoid using static access to class '\Soliant\SimpleFM\Client\ResultSet\Exception\ParseException' in method 'execute'.
    Open

    throw ParseException::fromConcreteException(
    (string) $dataSource['database'],
    (string) $dataSource['table'],
    (string) $dataSource['layout'],
    $e

    Avoid using static access to class '\Soliant\SimpleFM\Client\ResultSet\Exception\UnknownFieldException' in method 'getFieldTransformer'.
    Open

    throw UnknownFieldException::fromUnknownField();

    Avoid using static access to class '\Soliant\SimpleFM\Client\ResultSet\Exception\ParseException' in method 'getFieldTransformer'.
    Open

    throw ParseException::fromInvalidFieldType(
    (string) $fieldDefinition['name'],
    (string) $fieldDefinition['result']
    );

    Avoid using static access to class '\Soliant\SimpleFM\Client\ResultSet\Exception\UnknownFieldException' in method 'execute'.
    Open

    throw UnknownFieldException::fromConcreteException(
    (string) $dataSource['database'],
    (string) $dataSource['table'],
    (string) $dataSource['layout'],
    $e

    There are no issues that match your filters.

    Category
    Status