SU-SWS/stanford_profile_helper

View on GitHub
modules/stanford_person/modules/stanford_person_importer/src/Cap.php

Summary

Maintainability
A
1 hr
Test Coverage
A
97%

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

  protected function insertOrgData(array $org_data, TermInterface $parent = NULL): void {
    if (!isset($org_data['orgCodes'])) {
      return;
    }

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

    class Cap implements CapInterface {
    
      use StringTranslationTrait;
    
      /**

    CouplingBetweenObjects

    Since: 1.1.0

    A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

    Example

    class Foo {
        /**
         * @var \foo\bar\X
         */
        private $x = null;
    
        /**
         * @var \foo\bar\Y
         */
        private $y = null;
    
        /**
         * @var \foo\bar\Z
         */
        private $z = null;
    
        public function setFoo(\Foo $foo) {}
        public function setBar(\Bar $bar) {}
        public function setBaz(\Baz $baz) {}
    
        /**
         * @return \SplObjectStorage
         * @throws \OutOfRangeException
         * @throws \InvalidArgumentException
         * @throws \ErrorException
         */
        public function process(\Iterator $it) {}
    
        // ...
    }

    Source https://phpmd.org/rules/design.html#couplingbetweenobjects

    Missing class import via use statement (line '156', column '17').
    Open

          throw new \Exception($e->getMessage());

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Declaration of function setClientSecret(string $secret) : \Drupal\stanford_person_importer\Cap should be compatible with function setClientSecret(string $secret) : \Drupal\stanford_person_importer\CapInterface (method returning '\Drupal\stanford_person_importer\Cap' cannot override method returning '\Drupal\stanford_person_importer\CapInterface') defined in /code/modules/stanford_person/modules/stanford_person_importer/src/CapInterface.php:49
    Open

      public function setClientSecret(string $secret): self {

    Declaration of function setClientId(string $client_id) : \Drupal\stanford_person_importer\Cap should be compatible with function setClientId(string $client_id) : \Drupal\stanford_person_importer\CapInterface (method returning '\Drupal\stanford_person_importer\Cap' cannot override method returning '\Drupal\stanford_person_importer\CapInterface') defined in /code/modules/stanford_person/modules/stanford_person_importer/src/CapInterface.php:38
    Open

      public function setClientId(string $client_id): self {

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    Doc comment short description must end with a full stop
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    Doc comment short description must start with a capital letter
    Open

       * {@inheritDoc}

    There are no issues that match your filters.

    Category
    Status