FlameCore/Seabreeze

View on GitHub

Showing 6 of 8 total issues

Environment has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class Environment implements ManifestInterface
{
    /**
     * @var string
     */
Severity: Minor
Found in libraries/Manifest/Environment.php - About 2 hrs to fix

    Function deploy has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public function deploy(Environment $environment, $preserve = true)
        {
            if ($this->observer) {
                $this->observer->notify('deploy.start');
            }
    Severity: Minor
    Found in libraries/Deployer/Deployer.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 deploy has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function deploy(Environment $environment, $preserve = true)
        {
            if ($this->observer) {
                $this->observer->notify('deploy.start');
            }
    Severity: Minor
    Found in libraries/Deployer/Deployer.php - About 1 hr to fix

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

          public function import(array $configuration)
          {
              if (isset($configuration['synchronizers'])) {
                  $synchronizers = $configuration['synchronizers'];
                  foreach ($synchronizers as $mode => $settings) {
      Severity: Minor
      Found in libraries/Manifest/Environment.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

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

          public function writeManifest(ManifestInterface $object, $mustExist = false)
          {
              $filename = self::makeManifestPath($this->path, "$object.json");
              $directory = dirname($filename);
      
      
      Severity: Minor
      Found in libraries/Manifest/Project.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

      Function __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct($mode, array $settings, Environment $environment)
          {
              if (!isset($settings['from']) || !is_array($settings['from'])) {
                  throw new \InvalidArgumentException(sprintf('Synchronizer settings for "%s" do not contain "from" key.', $this->mode));
              }
      Severity: Minor
      Found in libraries/Manifest/SynchronizerJob.php - About 25 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

      Severity
      Category
      Status
      Source
      Language