puphpet/puphpet

View on GitHub

Showing 23 of 43 total issues

Method __construct has 316 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct()
    {
        /* mandatory requirements follow */

        $installedPhpVersion = phpversion();
Severity: Major
Found in app/SymfonyRequirements.php - About 1 day to fix

    File SymfonyRequirements.php has 514 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * This file is part of the Symfony package.
     *
    Severity: Major
    Found in app/SymfonyRequirements.php - About 1 day to fix

      File custom.js has 453 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var PUPHPET = {};
      
      /**
       * Catches anchor tag (#foo) in URL bar and displays proper tab
       */
      Severity: Minor
      Found in src/PuphpetBundle/Resources/public/custom.js - About 6 hrs to fix

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

            public function __construct()
            {
                /* mandatory requirements follow */
        
                $installedPhpVersion = phpversion();
        Severity: Minor
        Found in app/SymfonyRequirements.php - About 6 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 uploadConfig has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        PUPHPET.uploadConfig = function() {
            var dropzone = document.documentElement;
            var tid;
        
            dropzone.addEventListener('dragover', handleDragOver, false);
        Severity: Major
        Found in src/PuphpetBundle/Resources/public/custom.js - About 2 hrs to fix

          Function addBlock has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          PUPHPET.addBlock = function() {
              $(document).on('click', '[data-toggle="add-block"]', function(e){
                  e.stopPropagation();
                  e.preventDefault && e.preventDefault();
          
          
          Severity: Major
          Found in src/PuphpetBundle/Resources/public/custom.js - About 2 hrs to fix

            Function selectizeTagsUserInput has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            PUPHPET.selectizeTagsUserInput = function($element) {
                var $selectTagsUserInput = $('.select-tags-user-input', $element).selectize({
                    plugins: ['remove_button'],
                    delimiter: ',',
                    persist: false,
            Severity: Minor
            Found in src/PuphpetBundle/Resources/public/custom.js - About 2 hrs to fix

              Method postUploadConfigAction has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function postUploadConfigAction(Request $request)
                  {
                      $config = Helper\DataTransform::normalizeLineBreaks($request->get('config'));
              
                      $session = $this->getSession();
              Severity: Minor
              Found in src/PuphpetBundle/Controller/FrontController.php - About 1 hr to fix

                Function runSelectize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                PUPHPET.runSelectize = function($element) {
                    // input or select elements; allows user to create their own tags
                    var $selectTagsEditable = $('.tags, .select-tags-editable', $element).selectize({
                        plugins: ['remove_button'],
                        delimiter: ',',
                Severity: Minor
                Found in src/PuphpetBundle/Resources/public/custom.js - About 1 hr to fix

                  Method testZipReturnsAZipFileLocation has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function testZipReturnsAZipFileLocation()
                      {
                          $file1 = [
                              'name'    => 'foobar',
                              'content' => 'file1 content'
                  Severity: Minor
                  Found in src/PuphpetBundle/Tests/Unit/Extension/ArchiveTest.php - About 1 hr to fix

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

                        public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
                        {
                            $cfgValue = ini_get($cfgName);
                    
                            if (is_callable($evaluation)) {
                    Severity: Minor
                    Found in app/SymfonyRequirements.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 parseResponse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function parseResponse($liContainer, $nestedTabsContainer, $panelBodyContainer, $row) {
                            var $template = $('#nested-tabs-template').clone(true);
                            var $tabLink  = $template.find('[data-toggle="tab"]');
                            var rowId     = $row[0].getAttribute('id');
                            var uniqid    = $row[0].getAttribute('data-uniqid');
                    Severity: Minor
                    Found in src/PuphpetBundle/Resources/public/custom.js - About 1 hr to fix

                      Method testQueueToFileHoldsData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function testQueueToFileHoldsData()
                          {
                              $file1 = [
                                  'name'    => 'foobar',
                                  'content' => 'file1 content'
                      Severity: Minor
                      Found in src/PuphpetBundle/Tests/Unit/Extension/ArchiveTest.php - About 1 hr to fix

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

                            public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
                        Severity: Major
                        Found in app/SymfonyRequirements.php - About 50 mins to fix

                          Function uploadConfig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          PUPHPET.uploadConfig = function() {
                              var dropzone = document.documentElement;
                              var tid;
                          
                              dropzone.addEventListener('dragover', handleDragOver, false);
                          Severity: Minor
                          Found in src/PuphpetBundle/Resources/public/custom.js - 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

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

                              public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
                          Severity: Minor
                          Found in app/SymfonyRequirements.php - About 45 mins to fix

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

                                public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
                            Severity: Minor
                            Found in app/SymfonyRequirements.php - About 45 mins to fix

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

                                  public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
                              Severity: Minor
                              Found in app/SymfonyRequirements.php - About 35 mins to fix

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

                                PUPHPET.enforceGroupSingleChoice = function() {
                                    $('input[data-enforce-group-single]').on('change', function () {
                                        var $this = $(this);
                                
                                        var group = this.getAttribute('data-enforce-group-single');
                                Severity: Minor
                                Found in src/PuphpetBundle/Resources/public/custom.js - 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 setCustomDataAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function setCustomDataAll($data)
                                    {
                                        foreach ($this->extensions as $name => $extension) {
                                            if (!$formattedName = $this->vagrantfileHandling($data, $name)) {
                                                continue;
                                Severity: Minor
                                Found in src/PuphpetBundle/Extension/Manager.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

                                Severity
                                Category
                                Status
                                Source
                                Language