sixty-nine/php-cloud-lib

View on GitHub

Showing 108 of 109 total issues

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

        $imgWidth,
        $imgHeight,
        PlacerInterface $placer,
        FontMetrics $metrics,
        $precise = false,
Severity: Minor
Found in src/SixtyNine/Cloud/Usher/Usher.php - About 45 mins to fix

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

            $minWordLength,
            $maxWordLength,
            $changeCase = null,
            $noRemoveNumbers = false,
            $noRemoveUnwanted = false,
    Severity: Minor
    Found in src/SixtyNine/Cloud/Command/CommandsHelper.php - About 45 mins to fix

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

          public function drawText($x, $y, $text, $size, $color = '#000000', $angle = 0)
      Severity: Minor
      Found in src/SixtyNine/Cloud/Drawer/Drawer.php - About 45 mins to fix

        The class CommandsHelper has a coupling between objects value of 21. Consider to reduce the number of dependencies under 13.
        Open

        class CommandsHelper
        {
            protected $fontSizeBoosts = array('linear', 'dim', 'boost');
            protected $paletteTypes = array('cycle', 'random');
            protected $outputFormats = array('gif', 'jpeg', 'png');

        CouplingBetweenObjects

        Since: 1.1.0

        A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

        Example

        class Foo {
            /**
             * @var \foo\bar\X
             */
            private $x = null;
        
            /**
             * @var \foo\bar\Y
             */
            private $y = null;
        
            /**
             * @var \foo\bar\Z
             */
            private $z = null;
        
            public function setFoo(\Foo $foo) {}
            public function setBar(\Bar $bar) {}
            public function setBaz(\Baz $baz) {}
        
            /**
             * @return \SplObjectStorage
             * @throws \OutOfRangeException
             * @throws \InvalidArgumentException
             * @throws \ErrorException
             */
            public function process(\Iterator $it) {}
        
            // ...
        }

        Source https://phpmd.org/rules/design.html#couplingbetweenobjects

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

                CloudBuilder $cloudBuilder,
                FontsFactory $factory,
                PlacerInterface $placer = null,
                $renderBoxes = false,
                $renderMask = false
        Severity: Minor
        Found in src/SixtyNine/Cloud/Command/CommandsHelper.php - About 35 mins to fix

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

              public function drawBox($x, $y, $width, $height, $color = '#000000')
          Severity: Minor
          Found in src/SixtyNine/Cloud/Drawer/Drawer.php - About 35 mins to fix

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

                public static function getBoxForText($x, $y, $width, $height, $angle)
            Severity: Minor
            Found in src/SixtyNine/Cloud/Drawer/Drawer.php - About 35 mins to fix

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

                  public function addWordToMask($word, Box $place, $font, $size, $angle)
              Severity: Minor
              Found in src/SixtyNine/Cloud/Usher/PreciseMask.php - About 35 mins to fix

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

                    public function renderCloud()
                    {
                        /** @var \SixtyNine\Cloud\Model\CloudWord $word */
                        foreach ($this->cloud->getWords() as $word) {
                
                
                Severity: Minor
                Found in src/SixtyNine/Cloud/Renderer/CloudRenderer.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

                The method getFilterBuilder has a boolean flag argument $noRemoveTrailing, which is a certain sign of a Single Responsibility Principle violation.
                Open

                        $noRemoveTrailing = false

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                The method render has a boolean flag argument $renderBoxes, which is a certain sign of a Single Responsibility Principle violation.
                Open

                        $renderBoxes = false,

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                The method render has a boolean flag argument $renderMask, which is a certain sign of a Single Responsibility Principle violation.
                Open

                        $renderMask = false

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                The method getFilterBuilder has a boolean flag argument $noRemoveUnwanted, which is a certain sign of a Single Responsibility Principle violation.
                Open

                        $noRemoveUnwanted = false,

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                The method create has a boolean flag argument $isFontPath, which is a certain sign of a Single Responsibility Principle violation.
                Open

                    public static function create($fonts, $isFontPath = true)

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                The method __construct has a boolean flag argument $precise, which is a certain sign of a Single Responsibility Principle violation.
                Open

                        $precise = false,
                Severity: Minor
                Found in src/SixtyNine/Cloud/Usher/Usher.php by phpmd

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                Missing class import via use statement (line '251', column '18').
                Open

                        $d = new \DOMDocument;

                MissingImport

                Since: 2.7.0

                Importing all external classes in a file through use statements makes them clearly visible.

                Example

                function make() {
                    return new \stdClass();
                }

                Source http://phpmd.org/rules/cleancode.html#MissingImport

                The method __construct has a boolean flag argument $minLength, which is a certain sign of a Single Responsibility Principle violation.
                Open

                    public function __construct($minLength = false, $maxLength = false)

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                Missing class import via use statement (line '252', column '21').
                Open

                        $mock = new \DOMDocument;

                MissingImport

                Since: 2.7.0

                Importing all external classes in a file through use statements makes them clearly visible.

                Example

                function make() {
                    return new \stdClass();
                }

                Source http://phpmd.org/rules/cleancode.html#MissingImport

                The method getFilterBuilder has a boolean flag argument $noRemoveNumbers, which is a certain sign of a Single Responsibility Principle violation.
                Open

                        $noRemoveNumbers = false,

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                The method saveCloud has a boolean flag argument $pretty, which is a certain sign of a Single Responsibility Principle violation.
                Open

                    public function saveCloud(Cloud $cloud, $pretty = false)
                Severity: Minor
                Found in src/SixtyNine/Cloud/Serializer.php by phpmd

                BooleanArgumentFlag

                Since: 1.4.0

                A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                Example

                class Foo {
                    public function bar($flag = true) {
                    }
                }

                Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                Severity
                Category
                Status
                Source
                Language