kj187/aws-utility

View on GitHub

Showing 34 of 34 total issues

Method configure has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function configure()
    {
        $this
            ->addOption(
                'region',
Severity: Minor
Found in src/AwsUtility/Command/AbstractCommand.php - About 1 hr to fix

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

        protected function initialize(InputInterface $input, OutputInterface $output)
        {
            parent::initialize($input, $output);
    
            $this->region = $this->settings->get('defaults.region');
    Severity: Minor
    Found in src/AwsUtility/Command/AbstractCommand.php - About 1 hr to fix

      Function get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function get($settingKey)
          {
              $keys = explode('.', trim($settingKey));
              $keysCount = count($keys);
              $settings = $this->settings;
      Severity: Minor
      Found in src/AwsUtility/Settings.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

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

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $credentials = $this->getCredentials();
              if ($input->hasParameterOption('--assumeRole')) {
                  $credentials = $this->getAssumedRoleCredentials();
      Severity: Minor
      Found in src/AwsUtility/Command/ApiGateway/ProducerCommand.php - About 35 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

      Missing class import via use statement (line '44', column '40').
      Open

              $this->apiGatewayService = new \AwsUtility\Services\ApiGateway($client);

      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

      Missing class import via use statement (line '38', column '26').
      Open

              $signature = new \Aws\Signature\SignatureV4('execute-api', $this->getRegion());

      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

      Missing class import via use statement (line '42', column '22').
      Open

              foreach (new \DirectoryIterator($this->settings->get('services.kinesis.producer.mocks.path')) as $fileInfo) {

      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

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

                  new \AwsUtility\Command\Kinesis\ProducerCommand(),

      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

      Missing class import via use statement (line '35', column '23').
      Open

              $buffer = new \AwsUtility\Buffer(function(array $data) use ($streamName, $output) {

      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

      Missing class import via use statement (line '78', column '41').
      Open

                  $securityTokenService = new \AwsUtility\Security\TokenService($stsClient, $assumedRoleArn, $this->assumedRoleSessionName, $input->getOption('assumedRoleExternalId'));

      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

      Missing class import via use statement (line '70', column '30').
      Open

                  $stsClient = new \Aws\Sts\StsClient(

      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

      Missing class import via use statement (line '127', column '23').
      Open

                  throw new \Exception('No API Gateway resources available for RestAPI: ' . $restApiId);

      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

      Missing class import via use statement (line '39', column '23').
      Open

              $client = new \GuzzleHttp\Client();

      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

      Missing class import via use statement (line '133', column '27').
      Open

                      throw new \Exception('Resource path part "' . $resourcePathPart . '" not available');

      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

      Missing class import via use statement (line '35', column '23').
      Open

                  throw new \Exception('Credentials not found in sts:assumeRole response');

      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

      Missing class import via use statement (line '100', column '27').
      Open

                      throw new \Exception('RestAPI "' . $restApiName . '" not available');

      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

      Missing class import via use statement (line '43', column '23').
      Open

                  throw new \Exception('Directory with mocks are not available "' . $directoryPath . '". We expect a subdirectory with the API name and a second subdirectory with the resource name.');

      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

      Missing class import via use statement (line '27', column '23').
      Open

                  throw new \Exception('Configuration file "' . $file . '" not available. Expected file is configuration/settings.yaml');
      Severity: Minor
      Found in src/AwsUtility/Settings.php by phpmd

      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

      Missing class import via use statement (line '60', column '19').
      Open

              throw new \Exception('Setting with key ' . $settingKey . ' not available');
      Severity: Minor
      Found in src/AwsUtility/Settings.php by phpmd

      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

      Missing class import via use statement (line '67', column '27').
      Open

                      throw new \Exception('Option --assumedRoleArn empty');

      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

      Severity
      Category
      Status
      Source
      Language