kj187/aws-utility

View on GitHub

Showing 4 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

      Severity
      Category
      Status
      Source
      Language