partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

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

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

              onDeleteUpdateFieldButtonClick: function ()
              {
                  var selection = this.down("#batchJobUpdateFields").getSelectionModel().getSelection()[0];
                  if (selection) {
                      this.down("#batchJobUpdateFields").getStore().remove(selection);
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobEditor.js on lines 249..255

          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 76.

          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

              onDeleteQueryFieldButtonClick: function ()
              {
                  var selection = this.down("#batchJobQueryFields").getSelectionModel().getSelection()[0];
                  if (selection) {
                      this.down("#batchJobQueryFields").getStore().remove(selection);
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobEditor.js on lines 256..262

          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 76.

          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 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");
                
                

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

                      initComponent: function ()
                      {
                  
                          this.fieldSelector = Ext.create("PartKeepr.Components.Widgets.FieldSelector", {
                              height: 300,

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

                        createGlobalStores: function ()
                        {
                            this.footprintStore = Ext.create("Ext.data.Store",
                                {
                                    model: 'PartKeepr.FootprintBundle.Entity.Footprint',

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

                          onLogout: function ()
                          {
                              this.menuBar.disable();
                              this.centerPanel.removeAll(true);
                              this.getStatusbar().setDisconnected();
                      src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js on lines 110..117

                      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 75.

                      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

                          onLogout: function ()
                          {
                              this.menuBar.disable();
                              this.centerPanel.removeAll(true);
                              this.getStatusbar().setDisconnected();
                      src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js on lines 137..144

                      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 75.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language