stevebauman/maintenance

View on GitHub

Showing 68 of 213 total issues

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

    public function form(WorkOrder $workOrder, Attachment $attachment)
    {
        return $this->form->of('work-orders.attachments', function (FormGrid $form) use ($workOrder, $attachment) {
            $files = true;

Severity: Minor
Found in app/Http/Presenters/WorkOrder/WorkOrderAttachmentPresenter.php - About 1 hr to fix

    Function block_meta has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Markdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {
      // check if the last line of the block is an meta hash
      var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ );
      if ( !m ) return undefined;
    
    
    Severity: Minor
    Found in resources/assets/js/libs/markdown.js - About 1 hr to fix

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

          public function handle(Filesystem $filesystem)
          {
              $files = $this->request->file('files');
      
              if (is_array($files)) {
      Severity: Minor
      Found in app/Jobs/Attachment/Store.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 store has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function store($asset_id, $meter_id)
          {
              if ($this->meterReadingValidator->passes()) {
                  $asset = $this->asset->find($asset_id);
                  $meter = $this->meter->find($meter_id);
      Severity: Minor
      Found in app/Http/Controllers/Asset/Meter/ReadingController.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 updateEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function updateEvent(calendar, event) {
      
          var form =
              $('<form>', {
                  'method': 'POST',
      Severity: Minor
      Found in public/js/base.js - About 1 hr to fix

        Function updateEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function updateEvent(calendar, event) {
        
            var form =
                $('<form>', {
                    'method': 'POST',
        Severity: Minor
        Found in resources/assets/js/app.js - About 1 hr to fix

          Method up has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function up()
              {
                  Schema::create('meters', function (Blueprint $table) {
          
                      $table->increments('id');

            Method form has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function form(WorkRequest $request)
                {
                    return $this->form->of('work-requests', function (FormGrid $form) use ($request) {
                        if ($request->exists) {
                            $method = 'PATCH';
            Severity: Minor
            Found in app/Http/Presenters/WorkRequest/WorkRequestPresenter.php - About 1 hr to fix

              Method store has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function store($asset_id, $meter_id)
                  {
                      if ($this->meterReadingValidator->passes()) {
                          $asset = $this->asset->find($asset_id);
                          $meter = $this->meter->find($meter_id);
              Severity: Minor
              Found in app/Http/Controllers/Asset/Meter/ReadingController.php - About 1 hr to fix

                Function split_meta_hash has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function split_meta_hash( meta_string ) {
                  var meta = meta_string.split( "" ),
                      parts = [ "" ],
                      in_quotes = false;
                
                
                Severity: Minor
                Found in resources/assets/js/libs/markdown.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                  for (i = 0; i < stack.length; i++) {
                                    if ( stack[ i ].indent != m[1] ) continue;
                                    list = stack[ i ].list;
                                    stack.splice( i+1 );
                                    found = true;
                  Severity: Major
                  Found in resources/assets/js/libs/markdown.js - About 45 mins to fix

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

                    var showFormResponse = function (response, status, xhr, $form) {
                        /*
                         * Check if a message exists
                         */
                        if (typeof response.messageType !== 'undefined') {
                    Severity: Minor
                    Found in resources/assets/js/app.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

                    Function eventResize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            eventResize: function(event, delta, revertFunc, jsEvent, ui, view){
                    Severity: Minor
                    Found in resources/assets/js/calendar/full.js - About 45 mins to fix

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

                          protected function getOperator($string)
                          {
                              $allowed_operators = ['>', '<', '=', '>=', '<='];
                      
                              $output = preg_split("/[\[\]]/", $string);
                      Severity: Minor
                      Found in app/Models/Model.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

                      Avoid deeply nested control flow statements.
                      Open

                                    if ( --open_parens == 0) {
                                      consumed -= url.length - len;
                                      url = url.substring(0, len);
                                    }
                      Severity: Major
                      Found in resources/assets/js/libs/markdown.js - About 45 mins to fix

                        Function eventResize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                eventResize: function(event, delta, revertFunc, jsEvent, ui, view){
                        Severity: Minor
                        Found in public/js/calendar/full.js - About 45 mins to fix

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

                          var showFormResponse = function (response, status, xhr, $form) {
                              /*
                               * Check if a message exists
                               */
                              if (typeof response.messageType !== 'undefined') {
                          Severity: Minor
                          Found in public/js/base.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

                          Avoid deeply nested control flow statements.
                          Open

                                          if (!found) {
                                            //print("not found. l:", uneval(l));
                                            wanted_depth++;
                                            if (wanted_depth <= stack.length) {
                                              stack.splice(wanted_depth);
                          Severity: Major
                          Found in resources/assets/js/libs/markdown.js - About 45 mins to fix

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

                                public function response()
                                {
                                    if ($this->isAjax()) {
                                        if ($this->errors) {
                                            return $this->responseJson([
                            Severity: Minor
                            Found in app/Http/Controllers/Controller.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

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

                                public function scopeSort($query, $field = null, $sort = null)
                                {
                                    /*
                                     * Make sure both the field and sort variables are present
                                     */
                            Severity: Minor
                            Found in app/Models/Model.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

                            Severity
                            Category
                            Status
                            Source
                            Language