bragento/bragento-composer-installer

View on GitHub

Showing 24 of 24 total issues

AbstractStrategy has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class AbstractStrategy
{
    const EVENT_TIMING_PRE = 'pre';
    const EVENT_TIMING_POST = 'post';

Severity: Minor
Found in src/Deploy/Strategy/AbstractStrategy.php - About 3 hrs to fix

Manager has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

class Manager implements EventSubscriberInterface
{
    /**
     * instance
     *
Severity: Minor
Found in src/Deploy/Manager.php - About 3 hrs to fix

Function resolveMappings has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function resolveMappings(array $mappings)
    {
        $translatedMap = array();
        /** @var MapEntity $map */
        foreach ($mappings as $map) {
Severity: Minor
Found in src/Mapping/AbstractMapping.php - About 2 hrs 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

File AbstractStrategy.php has 265 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * AbstractStrategy.php
 *
 * PHP Version 5
Severity: Minor
Found in src/Deploy/Strategy/AbstractStrategy.php - About 2 hrs to fix

Function isIgnored has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function isIgnored($entry)
    {
        $entry = $this->normalizeEntry($entry);
        if ($this->hasEntry($entry)) {
            return true;
Severity: Minor
Found in src/Util/Gitignore.php - About 2 hrs 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

Method resolveMappings has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function resolveMappings(array $mappings)
    {
        $translatedMap = array();
        /** @var MapEntity $map */
        foreach ($mappings as $map) {
Severity: Minor
Found in src/Mapping/AbstractMapping.php - About 1 hr to fix

Method copy has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function copy($srcPath, $destPath, $override = false)
    {
        $srcPath = $this->normalizePath($srcPath);
        $destPath = $this->normalizePath($destPath);

Severity: Minor
Found in src/Util/Filesystem.php - About 1 hr to fix

Function createDelegates has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function createDelegates()
    {
        try {
            /** @var Mapping\MapEntity $map */
            foreach ($this->getMappingsArray() as $map) {
Severity: Minor
Found in src/Deploy/Strategy/AbstractStrategy.php - About 1 hr 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 checkDeployment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkDeployment(Event $event)
    {
        $root = Config::getInstance()->getMagentoRootDir();
        $deployedPackages = Manager::getInstance()->getDeployedPackages();
        $errors = 0;
Severity: Minor
Found in src/Deploy/Validate.php - About 1 hr 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 getElementPaths has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getElementPaths(\SimpleXMLElement $element)
    {
        $type = $element->getName();
        $typeAttributes = $element->attributes();
        $name = $typeAttributes[self::NAME_ATTRIBUTE];
Severity: Minor
Found in src/Mapping/Package.php - About 1 hr 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 getOverwrites has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function getOverwrites()
    {
        if (null === self::$overwrites) {
            $overwriteConfig = Config::getInstance()
                ->getDeployStrategyOverwrite();
Severity: Minor
Found in src/Deploy/Strategy/Factory.php - About 1 hr 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 parseMappings has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parseMappings()
    {
        $map = array();

        /** @var $package SimpleXMLElement */
Severity: Minor
Found in src/Mapping/Package.php - About 1 hr 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

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

    protected function parseMappings()
    {
        $map = array();
        $file = $this->getModmanFileObject();

Severity: Minor
Found in src/Mapping/Modman.php - About 1 hr to fix

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

    public function checkDeployment(Event $event)
    {
        $root = Config::getInstance()->getMagentoRootDir();
        $deployedPackages = Manager::getInstance()->getDeployedPackages();
        $errors = 0;
Severity: Minor
Found in src/Deploy/Validate.php - About 1 hr to fix

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

    protected function getElementPaths(\SimpleXMLElement $element)
    {
        $type = $element->getName();
        $typeAttributes = $element->attributes();
        $name = $typeAttributes[self::NAME_ATTRIBUTE];
Severity: Minor
Found in src/Mapping/Package.php - About 1 hr to fix

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

    protected function createDelegates()
    {
        try {
            /** @var Mapping\MapEntity $map */
            foreach ($this->getMappingsArray() as $map) {
Severity: Minor
Found in src/Deploy/Strategy/AbstractStrategy.php - About 1 hr to fix

Function copy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function copy($srcPath, $destPath, $override = false)
    {
        $srcPath = $this->normalizePath($srcPath);
        $destPath = $this->normalizePath($destPath);

Severity: Minor
Found in src/Util/Filesystem.php - About 55 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 getRelativePath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelativePath($from, $to)
    {
        $from = $this->getPathParts($from);
        $to = $this->getPathParts($to);

Severity: Minor
Found in src/Util/Filesystem.php - About 55 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 remove has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function remove($path)
    {
        if (false === file_exists($path)) {
            if (is_link($path)) {
                unlink($path);
Severity: Minor
Found in src/Util/Filesystem.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

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        PackageInterface $package,
        SplFileInfo $sourceDir,
        SplFileInfo $destDir,
        $action,
        Composer $composer,
Severity: Minor
Found in src/Deploy/Strategy/AbstractStrategy.php - About 45 mins to fix
Severity
Category
Status
Source
Language