bnomei/kirby3-janitor

View on GitHub

Showing 8 of 10 total issues

Function job has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function job(): array
    {
        $time = time();
        $climate = \Bnomei\Janitor::climate();

Severity: Minor
Found in classes/BackupZipJob.php - About 4 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

Function job has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function job(): array
    {
        $climate = Janitor::climate();
        $progress = null;
        $verbose = $climate ? $climate->arguments->defined('verbose') : false;
Severity: Minor
Found in classes/RenderJob.php - About 4 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

Function job has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function job(): array
    {
        $climate = Janitor::climate();
        $progress = null;
        $verbose = $climate ? $climate->arguments->defined('verbose') : false;
Severity: Minor
Found in classes/ThumbsJob.php - About 3 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 job has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function job(): array
    {
        $time = time();
        $climate = \Bnomei\Janitor::climate();

Severity: Major
Found in classes/BackupZipJob.php - About 3 hrs to fix

    Method job has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function job(): array
        {
            $climate = Janitor::climate();
            $progress = null;
            $verbose = $climate ? $climate->arguments->defined('verbose') : false;
    Severity: Major
    Found in classes/ThumbsJob.php - About 3 hrs to fix

      Method job has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function job(): array
          {
              $climate = Janitor::climate();
              $progress = null;
              $verbose = $climate ? $climate->arguments->defined('verbose') : false;
      Severity: Major
      Found in classes/RenderJob.php - About 3 hrs to fix

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

            public function job(): array
            {
                $dir = kirby()->root('sessions');
                $removed = 0;
                $finder = new Finder();
        Severity: Minor
        Found in classes/FlushSessionFilesJob.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 job has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function job(): array
            {
                $dir = kirby()->roots()->cache();
                $removed = 0;
                $finder = new Finder();
        Severity: Minor
        Found in classes/CleanCacheFilesJob.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

        Severity
        Category
        Status
        Source
        Language