sixty-nine/php-cloud-lib

View on GitHub

Showing 17 of 109 total issues

Method createCloud has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function createCloud($type, InputInterface $input)
    {
        Assert::oneOf($type, array('from-url', 'from-file'), 'Invalid type for createCloud: ' . $type);

        $stopwatch = new Stopwatch();
Severity: Major
Found in src/SixtyNine/Cloud/Command/CommandsHelper.php - About 2 hrs to fix

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

        protected function searchPlace(Box $bounds, Box $box)
        {
    
            $this->logger->log('  Search place for ' . $box, Logger::DEBUG);
    
    
    Severity: Minor
    Found in src/SixtyNine/Cloud/Usher/Usher.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 searchPlace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function searchPlace(Box $bounds, Box $box)
        {
    
            $this->logger->log('  Search place for ' . $box, Logger::DEBUG);
    
    
    Severity: Minor
    Found in src/SixtyNine/Cloud/Usher/Usher.php - About 1 hr to fix

      Method configure has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function configure()
          {
              $this
                  // Filters options
                  ->addOption('case', null, InputOption::VALUE_OPTIONAL, 'Change case filter type (uppercase, lowercase, ucfirst)')
      Severity: Minor
      Found in src/SixtyNine/Cloud/Command/BaseCloudCommand.php - About 1 hr to fix

        Function addWordToMask has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function addWordToMask($word, Box $place, $font, $size, $angle)
            {
                $base = $this->metrics->calculateSize($word, $font, $size, $angle);
                foreach (str_split($word) as $letter) {
                    $box = $this->metrics->calculateSize($letter, $font, $size);
        Severity: Minor
        Found in src/SixtyNine/Cloud/Usher/PreciseMask.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 drawBoxForText has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          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

                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

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

                            public function build($name)
                            {
                                $list = new WordsList();
                                $list->setName($name);
                        
                        
                        Severity: Minor
                        Found in src/SixtyNine/Cloud/Builder/WordsListBuilder.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

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

                            public function renderUsher(
                                PlacerInterface $placer,
                                $color = '#ff0000',
                                $maxIterations = 5000
                            ) {
                        Severity: Minor
                        Found in src/SixtyNine/Cloud/Renderer/CloudRenderer.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

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

                            public function build()
                            {
                                $filters = new Filters();
                        
                                if (null !== $this->case) {
                        Severity: Minor
                        Found in src/SixtyNine/Cloud/Builder/FiltersBuilder.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