partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

Function validateApplyButton has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    validateApplyButton: function () {
        var applyButton = this.down("#apply");

        if (this.down("#field").getValue() === "") {
            applyButton.setDisabled(true);

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

    updateRecord: function(record) {
        record = record || this._record;
        if (!record) {
            //<debug>
            Ext.raise("A record is required.");

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

    private function getFilterValueFromUrl($value)
    {
        if (is_array($value)) {
            $items = [];

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

    initComponent: function ()
    {
        this.columnListGrid = Ext.create("PartKeepr.Components.Widgets.ColumnConfigurator.ColumnListGrid", {
            region: 'west',
            width: 400,

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

        executeImport: function ()
        {
            //@todo Implement warning dialog
    
            Ext.Ajax.request({

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

          initComponent: function ()
          {
      
              this.acknowledgeButton = Ext.create("Ext.button.Button", {
                  text: i18n("Acknowledge Notice"),

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

            initComponent: function () {
        
                var c = this.initialConfig, sregion, hregion;
        
                if (!this.sideConfig) this.sideConfig = {};
        Severity: Minor
        Found in src/PartKeepr/FrontendBundle/Resources/public/js/Ext.ux.Wizard.js - About 1 hr to fix

          Method importUnits has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function importUnits($updateExisting = false)
              {
                  $path = $this->kernel->locateResource(self::UNIT_PATH.self::UNIT_DATA);
          
                  $yaml = new Parser();
          Severity: Minor
          Found in src/PartKeepr/SetupBundle/Services/UnitSetupService.php - About 1 hr to fix

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

                onUpdateParameters: function ()
                {
                    if (this.initial) { return; }
            
                    if (this.showHintCheckbox.checked) {
            Severity: Minor
            Found in web/setup/js/Cards/DatabaseParametersCard.MySQL.js - About 1 hr to fix

              Method testInternalPartNumberUniqueness has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function testInternalPartNumberUniqueness()
                  {
                      $client = static::makeClient(true);
              
                      /**
              Severity: Minor
              Found in src/PartKeepr/PartBundle/Tests/InternalPartNumberTest.php - About 1 hr to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                        for (var i = 0; i < importBehaviourChangeListeners.length; i++) {
                            this.down(importBehaviourChangeListeners[i]).on("change", this.onImportBehaviourChange, this, {delay: 50});
                        }
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImporterManyToOneConfiguration.js on lines 207..209

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 63.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                        for (var i = 0; i < importBehaviourChangeListeners.length; i++) {
                            this.down(importBehaviourChangeListeners[i]).on("change", this.onImportBehaviourChange, this, {delay: 50});
                        }
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImporterOneToManyConfiguration.js on lines 45..47

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 63.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Method onKernelView has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function onKernelView(GetResponseForControllerResultEvent $event)
                    {
                        $controllerResult = $event->getControllerResult();
                
                        if ($controllerResult instanceof Response) {

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                      bbar: [
                                          {
                                              xtype: 'button',
                                              iconCls: 'fugue-icon database--plus',
                                              itemId: 'addQueryFieldButton',
                  src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobEditor.js on lines 107..120

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                      if (selected.length == 1 && selected[0].data.data.type !== "onetomany") {
                                          addFieldButton.enable();
                                      } else {
                                          addFieldButton.disable();
                                      }
                  src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImportFieldMatcherGrid.js on lines 149..153

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                      if (selected.length == 1 && selected[0].data.data.type == "field") {
                                          addFieldButton.enable();
                                      } else {
                                          addFieldButton.disable();
                                      }
                  src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/FieldSelectorWindow.js on lines 29..33

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                      bbar: [
                                          {
                                              xtype: 'button',
                                              iconCls: 'fugue-icon database--plus',
                                              itemId: 'addUpdateFieldButton',
                  src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobEditor.js on lines 46..59

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      initComponent: function ()
                      {
                          this.callParent(arguments);
                          this.visitedModels = [];
                  
                  

                    Function onSuccess has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        onSuccess: function (responseObj, options)
                        {
                            PartKeepr.getApplication().getStatusbar().endLoad();
                    
                            try {

                      Function execute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          execute: function ()
                          {
                              this.searchStore = Ext.create("Ext.data.Store", {
                                  model: 'PartKeepr.PartBundle.Entity.Part',
                                  autoLoad: false,
                        Severity
                        Category
                        Status
                        Source
                        Language