Showing 9 of 9 total issues

Function parseConfiguration has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public static function parseConfiguration($path)
    {
        if (!is_file($path) || !is_readable($path)) throw new \InvalidArgumentException('Path ' . $path . ' is invalid.');

        $config = @json_decode(file_get_contents($path), true);
Severity: Minor
Found in src/Berk.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 execute has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute(InputInterface $i, OutputInterface $o)
    {
        $server     = $i->getArgument('server');
        $dry        = $i->getOption('dry') === true;
        $all        = $i->getOption('all') === true;
Severity: Major
Found in src/Tool/Command/DeployCommand.php - About 2 hrs to fix

    Method execute has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function execute(InputInterface $i, OutputInterface $o)
        {
            $revision_from = $i->getOption('from');
            $revision_to   = $i->getOption('to');
            $uncommited    = $i->getOption('uncommited') === true;
    Severity: Minor
    Found in src/Tool/Command/ExportCommand.php - About 1 hr to fix

      Method parseConfiguration has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function parseConfiguration($path)
          {
              if (!is_file($path) || !is_readable($path)) throw new \InvalidArgumentException('Path ' . $path . ' is invalid.');
      
              $config = @json_decode(file_get_contents($path), true);
      Severity: Minor
      Found in src/Berk.php - About 1 hr to fix

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

            public function execute(InputInterface $i, OutputInterface $o)
            {
                $server     = $i->getArgument('server');
                $dry        = $i->getOption('dry') === true;
                $all        = $i->getOption('all') === true;
        Severity: Minor
        Found in src/Tool/Command/DeployCommand.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 execute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function execute(InputInterface $i, OutputInterface $o)
            {
                $server       = $i->getArgument('server');
                $set_revision = $i->getOption('set-revision');
                $show_log     = (int) $i->getOption('log');
        Severity: Minor
        Found in src/Tool/Command/ServerCommand.php - About 1 hr to fix

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

              public function __construct($host, $port, $username, $password, $path)
          Severity: Minor
          Found in src/Ftp.php - About 35 mins to fix

            Function execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function execute(InputInterface $i, OutputInterface $o)
                {
                    $server       = $i->getArgument('server');
                    $set_revision = $i->getOption('set-revision');
                    $show_log     = (int) $i->getOption('log');
            Severity: Minor
            Found in src/Tool/Command/ServerCommand.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

            Avoid too many return statements within this method.
            Open

                                return copy($source, $target);
            Severity: Major
            Found in src/Tool/Command/ExportCommand.php - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language