Showing 90 of 102 total issues
Function executeWithBlueprint
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
protected function executeWithBlueprint(Blueprint $blueprint, InputInterface $input, OutputInterface $output)
{
$dryRun = $input->getOption('dryrun');
if ($dryRun) {
$formatter = new \Symfony\Component\Console\Helper\FormatterHelper();
- 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 merge
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function merge(array $templates, $description = null, array $additionalData = [])
{
if (count($templates) == 0) {
throw new \InvalidArgumentException('No templates given');
}
- 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 hasAccess
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function hasAccess($origin, $port, $protocol='tcp') {
foreach ($this->getIpPermissions() as $permission) {
if ($permission['IpProtocol'] != $protocol || $permission['FromPort'] != $port) {
continue;
}
- 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 executeWithBlueprint
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function executeWithBlueprint(Blueprint $blueprint, InputInterface $input, OutputInterface $output)
{
$dryRun = $input->getOption('dryrun');
if ($dryRun) {
$formatter = new \Symfony\Component\Console\Helper\FormatterHelper();
Function interact
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instance = $input->getArgument('instance');
if (empty($instance)) {
// find instances based on tag(s)
- 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 interact
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instance = $input->getArgument('instance');
if (empty($instance)) {
// find instances based on tag(s)
- 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 getParameters
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getParameters($resolvePlaceholders = true)
{
$this->applyEnvVars();
$parameters = [];
- 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 executeWithStack
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function executeWithStack(Stack $stack, InputInterface $input, OutputInterface $output)
{
$events = $stack->getEvents();
$groups = [];
Function executeWithStack
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function executeWithStack(Stack $stack, InputInterface $input, OutputInterface $output)
{
$events = $stack->getEvents();
$groups = [];
- 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 getConfigTreeBuilder
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('root');
$rootNode
Function getStacksFromApi
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getStacksFromApi($fresh=false, $nameFilter=null, $statusFilter=null)
{
if ($fresh || is_null($this->stacksCache)) {
$this->stacksCache = [];
$nextToken = '';
- 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 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$nameFilter = $input->getOption('nameFilter');
$stacks = $this->getStackFactory()->getStacksFromApi(false, $nameFilter);
Method merge
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function merge(array $templates, $description = null, array $additionalData = [])
{
if (count($templates) == 0) {
throw new \InvalidArgumentException('No templates given');
}
Stack
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Stack {
CONST METADATA_KEY = 'StackFormation';
CONST METADATA_KEY_BLUEPRINT = 'Blueprint';
CONST METADATA_KEY_ENVVARS = 'EnvironmentVariables';
Function __construct
has a Cognitive Complexity of 16 (exceeds 5 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");
- 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 interactAskForBlueprint
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function interactAskForBlueprint(InputInterface $input, OutputInterface $output)
{
$blueprint = $input->getArgument('blueprint');
if (empty($blueprint) || strpos($blueprint, '*') !== false || strpos($blueprint, '?') !== false) {
- 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 getDecodedJson
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getDecodedJson()
{
if ($this->prefix) {
if (!$this->cache->has(__METHOD__)) {
$array = parent::getDecodedJson();
- 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 validateTags
has a Cognitive Complexity of 16 (exceeds 5 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');
- 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 interact
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instance = $input->getArgument('instance');
if (empty($instance)) {
// find instances based on tag(s)
Function findByStackname
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function findByStackname($stackname)
{
foreach ($this->config->getBlueprintNames() as $blueprintName) {
if (strpos($blueprintName, '{env:') !== false) {
$regex = preg_replace('/\{env:([^:\}\{]+?)\}/', '(?P<$1>\w+)', $blueprintName);
- 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"