Showing 102 of 102 total issues
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 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 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 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
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 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 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 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
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 getDefaultUsername
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getDefaultUsername()
{
if (is_null($this->username)) {
if ($user = $this->getInspectorConfiguration('user')) {
$this->username = $user;
- 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 __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function __construct($privateKeyFile)
{
if (is_file($privateKeyFile)) {
$this->privateKeyFile = $privateKeyFile;
} else {
- 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 parametersAreEqual
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parametersAreEqual(array $paramA, array $paramB)
{
// skip password fields
while (($passWordKeyInA = array_search('****', $paramA)) !== false) {
unset($paramA[$passWordKeyInA]);
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$logGroupName = $input->getArgument('group') ?: '*';
$repository = new Repository();
- 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 flatternTree
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function flatternTree(array $treeIn)
{
$treeOut = [];
foreach ($treeIn as $name => $children) {
if (count($children) === 0) {
- 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 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"
Further reading
Method trackStackDependency
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function trackStackDependency($type, $stack, $resource, Blueprint $sourceBlueprint=null, $sourceType=null, $sourceKey=null)
Function tunnel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function tunnel($configuration)
{
$configurationData = explode(':', $configuration);
if (count($configurationData) == 4) {
- 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 trackEnvUsage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function trackEnvUsage($envVar, $withDefault=false, $value, Blueprint $sourceBlueprint=null, $sourceType=null, $sourceKey=null)