partkeepr/PartKeepr

View on GitHub

Showing 481 of 922 total issues

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

    initComponent: function ()
    {
        /**
         * Due to an ExtJS issue, we need to delay the event
         * for a bit.

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

        createFormConfig: function (renderer)
        {
            var configIterator, config, field, fields = [], useDescriptionElemement;
    
            for (configIterator in renderer.rendererConfigs)

      UploadedFile has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class UploadedFile extends BaseEntity
      {
          /**
           * Specifies the type of the file.
           *
      Severity: Minor
      Found in src/PartKeepr/UploadedFileBundle/Entity/UploadedFile.php - About 2 hrs to fix

        Function createPicker has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            createPicker: function ()
            {
                this.partsGrid = Ext.create("PartKeepr.PartsGrid", {
                    enableTopToolbar: true,
                    enableEditing: false,

          File BatchJobEditor.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          Ext.define('PartKeepr.BatchJobEditor', {
              extend: 'PartKeepr.Editor',
              alias: 'widget.BatchJobEditor',
          
              defaults: {

            Method testUploadAction has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function testUploadAction()
                {
                    $client = static::makeClient(true);
            
                    $file = __DIR__.'/Fixtures/files/uploadtest.png';

              Function keyHandler has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  keyHandler: function (field, e) {
                      var picker = this.getPicker(),
                          currentSelection, index;
                      switch (e.getKey()) {
                          case e.DOWN:

              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 keyHandler has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  keyHandler: function (field, e)
                  {
                      var picker = this.getPicker();
                      var grid = picker.getGrid();
              
              

              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 buildUrl has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  buildUrl: function (request)
                  {
                      var operation = request.getOperation();
              
                      // Set the URI to the ID, as JSON-LD operates on IRIs.
              Severity: Minor
              Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraProxy.js - About 2 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 getEditingContext has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  getEditingContext: function (record, columnHeader)
                  {
                      var me = this,
                          grid = me.grid,
                          colMgr = grid.visibleColumnManager,

              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 setAssociationData has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  setAssociationData: function (data)
                  {
                      var setterName, getterName, roleName, store, idProperty;
              
                      for (roleName in data) {
              Severity: Minor
              Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js - About 2 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 flatten has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function flatten($data, $mappings)
                  {
                      $accessor = PropertyAccess::createPropertyAccessor();
                      $finalData = [];
                      foreach ($data as $key => $row) {

              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 initComponent has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  initComponent: function ()
                  {
                      // Initialize the window with the title template
                      this.title = this.titleTemplate;
              
              

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

                    initComponent: function ()
                    {
                        /**
                         * Due to an ExtJS issue, we need to delay the event
                         * for a bit.

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

                      onItemSave: function ()
                      {
                          var removeRecords = [], j, errors = [],
                              minDistributorCount = PartKeepr.getApplication().getSystemPreference(
                                  "partkeepr.part.constraints.distributorCount", 0),

                    File Ext.ux.Wizard.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    Ext.define('Ext.ux.Wizard', {
                        extend: 'Ext.window.Window',
                        // layout: 'Ext.ux.wizard.CardLayout',
                        layout: 'fit',
                        loadMaskConfig: {
                    Severity: Minor
                    Found in src/PartKeepr/FrontendBundle/Resources/public/js/Ext.ux.Wizard.js - About 2 hrs to fix

                      Function initComponent has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          initComponent: function () {
                              this.on("startEdit", this.onEditStart, this, { delay: 50 });
                              
                              this.attachmentGrid = Ext.create("PartKeepr.FootprintAttachmentGrid", {
                                  height: 200,

                        Method replaceTemporaryFile has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function replaceTemporaryFile(GetResponseForControllerResultEvent $event)
                            {
                                $data = $event->getControllerResult();
                        
                                if (!is_object($data)) {

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

                              getGrid: function () {
                                  var store = this.getStore(),
                                      pagingBar = Ext.widget('pagingtoolbar', {
                                          store: store,
                                          displayInfo: true,

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

                                appendFieldData: function (field, node)
                                {
                                    var fieldData = {};
                                    fieldData.data = node.get("data");
                            
                            
                              Severity
                              Category
                              Status
                              Source
                              Language