soliantconsulting/SimpleFM

View on GitHub

Showing 44 of 330 total issues

Method testGetIterator has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testGetIterator()
    {
        $first = new stdClass();
        $second = new stdClass();
        $third = new stdClass();
Severity: Minor
Found in test/Repository/LazyLoadedCollectionTest.php - About 1 hr to fix

    Method parameterProvider has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function parameterProvider() : array
        {
            return [
                'no-parameters' => [
                    [],
    Severity: Minor
    Found in test/Connection/CommandTest.php - About 1 hr to fix

      Method testOneToManyHydrationWithEntity has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testOneToManyHydrationWithEntity(bool $eagerHydration)
          {
              $entityPrototype = new class
              {
                  public $bar;
      Severity: Minor
      Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

        Method __construct has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                string $propertyName,
                string $targetTable,
                string $targetEntity,
                string $targetFieldName,
                string $targetInterfaceName = null,
        Severity: Major
        Found in src/Repository/Builder/Metadata/OneToOne.php - About 1 hr to fix

          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

            Method testOneToOneInverseHydrationWithoutEntity has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function testOneToOneInverseHydrationWithoutEntity(bool $eagerHydration)
                {
                    $entityPrototype = new class
                    {
                        public $baz;
            Severity: Minor
            Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

              Method testOneToOneOwningHydrationWithoutEntity has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function testOneToOneOwningHydrationWithoutEntity(bool $eagerHydration)
                  {
                      $entityPrototype = new class
                      {
                          public $baz;
              Severity: Minor
              Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

                Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        string $layout,
                        string $className,
                        array $fields,
                        array $embeddables,
                        array $oneToMany,
                Severity: Major
                Found in src/Repository/Builder/Metadata/Entity.php - About 1 hr to fix

                  Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          string $fieldName,
                          string $propertyName,
                          string $targetTable,
                          string $targetEntity,
                          string $targetPropertyName,
                  Severity: Major
                  Found in src/Repository/Builder/Metadata/ManyToOne.php - About 1 hr to fix

                    Method testManyToOneHydrationWithoutEntity has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function testManyToOneHydrationWithoutEntity(bool $eagerHydration)
                        {
                            $entityPrototype = new class
                            {
                                public $baz;
                    Severity: Minor
                    Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

                      Function buildProxyClass has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function buildProxyClass(
                              string $entityInterfaceName,
                              string $proxyNamespace,
                              string $proxyClassName
                          ) : string {
                      Severity: Minor
                      Found in src/Repository/Builder/Proxy/ProxyBuilder.php - About 1 hr 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

                      Method testProxyExtraction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function testProxyExtraction()
                          {
                              $entity = new class
                              {
                                  private $baz = 'bat';
                      Severity: Minor
                      Found in test/Repository/Builder/MetadataExtractionTest.php - About 1 hr to fix

                        Function __toString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function __toString() : string
                            {
                                $parts = [];
                        
                                foreach ($this->parameters as $name => $value) {
                        Severity: Minor
                        Found in src/Connection/Command.php - About 55 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 toParameters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function toParameters() : array
                            {
                                if (empty($this->queries)) {
                                    throw EmptyQueryException::fromEmptyQueryArray();
                                }
                        Severity: Minor
                        Found in src/Repository/Query/FindQuery.php - About 45 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

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

                                string $fieldName,
                                string $propertyName,
                                TypeInterface $type,
                                bool $repeatable,
                                bool $readOnly
                        Severity: Minor
                        Found in src/Repository/Builder/Metadata/Field.php - About 35 mins to fix

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

                                  array $search,
                                  array $sort = [],
                                  int $limit = null,
                                  int $offset = null,
                                  bool $autoQuoteSearch = true
                          Severity: Minor
                          Found in src/Repository/RepositoryInterface.php - About 35 mins to fix

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

                                    string $propertyName,
                                    string $targetTable,
                                    string $targetEntity,
                                    string $targetFieldName,
                                    bool $eagerHydration = false
                            Severity: Minor
                            Found in src/Repository/Builder/Metadata/OneToMany.php - About 35 mins to fix

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

                                      HttpClient $httpClient,
                                      UriInterface $uri,
                                      string $database,
                                      IdentityHandlerInterface $identityHandler = null,
                                      LoggerInterface $logger = null
                              Severity: Minor
                              Found in src/Connection/Connection.php - About 35 mins to fix

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

                                        array $search,
                                        array $sort = [],
                                        int $limit = null,
                                        int $offset = null,
                                        bool $autoQuoteSearch = true
                                Severity: Minor
                                Found in src/Repository/Repository.php - About 35 mins 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

                                  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