Showing 90 of 102 total issues
Method interactAskForBlueprint
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interactAskForBlueprint(InputInterface $input, OutputInterface $output)
{
$blueprint = $input->getArgument('blueprint');
if (empty($blueprint) || strpos($blueprint, '*') !== false || strpos($blueprint, '?') !== false) {
Method getStacksFromApi
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStacksFromApi($fresh=false, $nameFilter=null, $statusFilter=null)
{
if ($fresh || is_null($this->stacksCache)) {
$this->stacksCache = [];
$nextToken = '';
Function getEnvVarsForProfile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getEnvVarsForProfile($profile) {
$envVars = [];
if (!$this->isValidProfile($profile)) {
throw new \Exception("Invalid profile: $profile");
}
- Read upRead up
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 execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
Registry::set('output', $output);
$instance = $input->getArgument('instance');
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$iam = new \AwsInspector\Model\Iam\Repository();
$accountId = $iam->findCurrentUser()->getAccountId();
Method doRequest
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doRequest() {
$this->responseHeaders = [];
$this->responseBody = [];
$command = $this->getCurlCommand();
Method getHttpHandler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getHttpHandler()
{
$guzzleStack = \GuzzleHttp\HandlerStack::create();
$guzzleStack->push(\GuzzleHttp\Middleware::retry(
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$groupPattern = $input->getArgument('group');
if (empty($groupPattern)) {
$groupPattern = '.*';
Method validateTags
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function validateTags(array $tags)
{
// @see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
if (count($tags) > 10) {
throw new \Exception('No more than 10 tags are allowed');
Function getStackDependenciesAsFlatList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getStackDependenciesAsFlatList()
{
$rows = [];
foreach ($this->stacks as $type => $typeData) {
foreach ($typeData as $stackName => $stackData) {
- Read upRead up
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 compare
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function compare()
{
if (empty($this->stack)) {
throw new \InvalidArgumentException('Stack not set');
}
- Read upRead up
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 getDetailedLogFromResourceStatusReason
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getDetailedLogFromResourceStatusReason($resourceStatusReason)
{
$logMessages = [];
if (preg_match('/See the details in CloudWatch Log Stream: (.*)/', $resourceStatusReason, $matches)) {
$logStream = $matches[1];
- Read upRead up
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 findDependantsForStack
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function findDependantsForStack($stackName)
{
$dependants = [];
foreach ($this->stacks as $type => $typeData) {
if (isset($typeData[$stackName])) {
- Read upRead up
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 10 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
// TODO: refactor this to use \AwsInspector\Model\CloudWatchLogs\Repository
$days = $input->getArgument('days');
- Read upRead up
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 getEnvDependenciesAsFlatList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getEnvDependenciesAsFlatList()
{
$rows = [];
foreach ($this->envVars as $type => $typeData) {
foreach ($typeData as $envVar => $tmp) {
- Read upRead up
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 findCloudWatchLogGroupByStream
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function findCloudWatchLogGroupByStream($stream, $logGroupNamePrefix = null)
{
return null; // TODO: FIx this!
- Read upRead up
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 deploy
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function deploy($dryRun=false, $force=false)
{
$arguments = $this->prepareArguments($force);
if (!$dryRun) {
- Read upRead up
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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(array $files=null)
{
$files = is_null($files) ? $this->findAllConfigurationFiles() : $files;
if (count($files) == 0) {
throw new \StackFormation\Exception\NoBlueprintsFoundException("Could not find any blueprints.yml configuration files");
Method hasAccess
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hasAccess($origin, $port, $protocol='tcp') {
foreach ($this->getIpPermissions() as $permission) {
if ($permission['IpProtocol'] != $protocol || $permission['FromPort'] != $port) {
continue;
}
Function doRequest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function doRequest() {
$this->responseHeaders = [];
$this->responseBody = [];
$command = $this->getCurlCommand();
- Read upRead up
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"