stevebauman/maintenance

View on GitHub

Showing 68 of 213 total issues

File markdown.js has 999 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)

Severity: Major
Found in resources/assets/js/libs/markdown.js - About 2 days to fix

    File bootstrap-markdown.js has 978 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* ===================================================
     * bootstrap-markdown.js v2.9.0
     * http://github.com/toopay/bootstrap-markdown
     * ===================================================
     * Copyright 2013-2015 Taufan Aditya
    Severity: Major
    Found in resources/assets/js/libs/bootstrap-markdown.js - About 2 days to fix

      File routes.php has 462 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      use Illuminate\Routing\Router;
      
      /*
      Severity: Minor
      Found in app/Http/routes.php - About 7 hrs to fix

        Function showEditor has 168 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          , showEditor: function() {
              var instance = this,
                  textarea,
                  ns = this.$ns,
                  container = this.$element,
        Severity: Major
        Found in resources/assets/js/libs/bootstrap-markdown.js - About 6 hrs to fix

          Function lists has 156 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              lists: (function( ) {
                // Use a closure to hide a few variables.
                var any_list = "[*+-]|\\d+\\.",
                    bullet_list = /[*+-]/,
                    number_list = /\d+\./,
          Severity: Major
          Found in resources/assets/js/libs/markdown.js - About 6 hrs to fix

            Function toMarkdown has 145 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var toMarkdown = function(string) {
              
              var ELEMENTS = [
                {
                  patterns: 'p',
            Severity: Major
            Found in resources/assets/js/libs/to-markdown.js - About 5 hrs to fix

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

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

                Function toMarkdown has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                Open

                var toMarkdown = function(string) {
                  
                  var ELEMENTS = [
                    {
                      patterns: 'p',
                Severity: Minor
                Found in resources/assets/js/libs/to-markdown.js - About 5 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

                File base.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // JavaScript Document
                
                /*
                 * Set ajax cache to false to prevent back
                 * button from spewing json responses
                Severity: Minor
                Found in public/js/base.js - About 4 hrs to fix

                  File app.js has 360 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // JavaScript Document
                  
                  /*
                   * Set ajax cache to false to prevent back
                   * button from spewing json responses
                  Severity: Minor
                  Found in resources/assets/js/app.js - About 4 hrs to fix

                    Function convert_tree_to_html has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function convert_tree_to_html( tree, references, options ) {
                      var i;
                      options = options || {};
                    
                      // shallow clone
                    Severity: Major
                    Found in resources/assets/js/libs/markdown.js - About 4 hrs to fix

                      WorkOrderViewer has 31 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class WorkOrderViewer extends BaseViewer
                      {
                          /**
                           * The work order profile view.
                           *
                      Severity: Minor
                      Found in app/Viewers/WorkOrder/WorkOrderViewer.php - About 3 hrs to fix

                        File permissions.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /*
                         * Default Permissions configuration file.
                         *
                        Severity: Minor
                        Found in resources/config/maintenance/permissions.php - About 3 hrs to fix

                          WorkOrder has 28 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class WorkOrder extends Model
                          {
                              use SoftDeletes, HasNotesTrait, HasLocationTrait, HasUserTrait, HasEventsTrait, HasCategoryTrait;
                          
                              /**
                          Severity: Minor
                          Found in app/Models/WorkOrder.php - About 3 hrs to fix

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

                                public function form(Asset $asset)
                                {
                                    return $this->form->of('assets', function (FormGrid $form) use ($asset) {
                                        if ($asset->exists) {
                                            $method = 'PATCH';
                            Severity: Major
                            Found in app/Http/Presenters/Asset/AssetPresenter.php - About 3 hrs to fix

                              EventViewer has 24 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class EventViewer extends BaseViewer
                              {
                                  /**
                                   * Returns the API events profile view.
                                   *
                              Severity: Minor
                              Found in app/Viewers/Event/EventViewer.php - About 2 hrs to fix

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

                                    public function form(WorkOrder $workOrder)
                                    {
                                        return $this->form->of('work-orders', function (FormGrid $form) use ($workOrder) {
                                            if ($workOrder->exists) {
                                                $method = 'PATCH';
                                Severity: Major
                                Found in app/Http/Presenters/WorkOrder/WorkOrderPresenter.php - About 2 hrs to fix

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

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

                                    Function datePicker has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        Grid.Index.datePicker = function()
                                        {
                                            var startDate, endDate, config, filter;
                                    
                                            var filters = _.compact(
                                    Severity: Major
                                    Found in public/js/grid.js - About 2 hrs to fix

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

                                          "[": function link( text ) {
                                      
                                            var orig = String(text);
                                            // Inline content is possible inside `link text`
                                            var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), ']' );
                                      Severity: Minor
                                      Found in resources/assets/js/libs/markdown.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language