modxcms/revolution

View on GitHub
manager/min/lib/Minify.php

Summary

Maintainability
D
3 days
Test Coverage

Function serve has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    public static function serve($controller, $options = array())
    {
        if (! self::$isDocRootSet && 0 === stripos(PHP_OS, 'win')) {
            self::setDocRoot();
        }
Severity: Minor
Found in manager/min/lib/Minify.php - About 1 day 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 serve has 155 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function serve($controller, $options = array())
    {
        if (! self::$isDocRootSet && 0 === stripos(PHP_OS, 'win')) {
            self::setDocRoot();
        }
Severity: Major
Found in manager/min/lib/Minify.php - About 6 hrs to fix

    File Minify.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Class Minify  
     * @package Minify
     */
    Severity: Minor
    Found in manager/min/lib/Minify.php - About 4 hrs to fix

      Method _combineMinify has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected static function _combineMinify()
          {
              $type = self::$_options['contentType']; // ease readability
              
              // when combining scripts, make sure all statements separated and
      Severity: Major
      Found in manager/min/lib/Minify.php - About 2 hrs to fix

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

            protected static function _combineMinify()
            {
                $type = self::$_options['contentType']; // ease readability
                
                // when combining scripts, make sure all statements separated and
        Severity: Minor
        Found in manager/min/lib/Minify.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 _handleCssImports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected static function _handleCssImports($css)
            {
                if (self::$_options['bubbleCssImports']) {
                    // bubble CSS imports
                    preg_match_all('/@import.*?;/', $css, $imports);
        Severity: Minor
        Found in manager/min/lib/Minify.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

        There are no issues that match your filters.

        Category
        Status