partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

File PartsManager.js has 482 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @class PartKeepr.PartManager
 * @todo Document the editor system a bit better
 *
 * The part manager encapsulates the category tree, the part display grid and the part detail view.

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

            this.manufacturerFilterCombo = Ext.create("PartKeepr.ManufacturerComboBox", {
                flex: 1,
                plugins: [
                    Ext.create("PartKeepr.Util.FilterPlugin", {
                        getFilterFn: function ()
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 815..847
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 871..903

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

    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 3 locations. Consider refactoring.
    Open

            this.footprintFilterCombo = Ext.create("PartKeepr.FootprintComboBox", {
                flex: 1,
                plugins: [
                    Ext.create("PartKeepr.Util.FilterPlugin", {
                        getFilterFn: function ()
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 760..792
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 815..847

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

    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

            this.partsWithoutStockRemovals = Ext.create("Ext.form.field.Checkbox", {
                fieldLabel: i18n("Stock Settings"),
                boxLabel: i18n("Show Parts without stock removals only"),
                plugins: [
                    Ext.create("PartKeepr.Util.FilterPlugin", {
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 705..742

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

    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 3 locations. Consider refactoring.
    Open

            this.distributorFilterCombo = Ext.create("PartKeepr.DistributorComboBox", {
                flex: 1,
                plugins: [
                    Ext.create("PartKeepr.Util.FilterPlugin", {
                        getFilterFn: function ()
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 760..792
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 871..903

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

    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

            this.needsReview = Ext.create("Ext.form.field.Checkbox", {
                fieldLabel: i18n("Needs Review"),
                boxLabel: i18n("Show Parts that need to reviewed only"),
                plugins: [
                    Ext.create("PartKeepr.Util.FilterPlugin", {
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 664..701

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

    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

    File Importer.js has 480 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    Ext.define("PartKeepr.Importer.Importer", {
        extend: "Ext.panel.Panel",
        layout: 'border',
        bbar: [
            {

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

          getAssociationData: function ()
          {
              var roleName, values = [], role, item, store;
      
              for (roleName in this.associations) {
      src/PartKeepr/FrontendBundle/Resources/public/js/Data/CallActions.js on lines 71..93

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

      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

          getAssociationData: function ()
          {
              var roleName, values = [], role, item, store;
      
              for (roleName in this.associations) {
      src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js on lines 264..286

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

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

          make: function (node, model, prefix, callback)
          {
              var newNode,i ,j, childNode, associationAlreadyProcessed;
      
              if (!prefix) {

      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

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

      <?php
      
      namespace PartKeepr\PartBundle\Listeners;
      
      use Doctrine\ORM\EntityManager;
      Severity: Major
      Found in src/PartKeepr/PartBundle/Listeners/CategoryPathListener.php and 2 other locations - About 7 hrs to fix
      src/PartKeepr/FootprintBundle/Listeners/CategoryPathListener.php on lines 1..63
      src/PartKeepr/StorageLocationBundle/Listeners/CategoryPathListener.php on lines 1..63

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

      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 3 locations. Consider refactoring.
      Open

      <?php
      
      namespace PartKeepr\StorageLocationBundle\Listeners;
      
      use Doctrine\ORM\EntityManager;
      src/PartKeepr/FootprintBundle/Listeners/CategoryPathListener.php on lines 1..63
      src/PartKeepr/PartBundle/Listeners/CategoryPathListener.php on lines 1..63

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

      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 3 locations. Consider refactoring.
      Open

      <?php
      
      namespace PartKeepr\FootprintBundle\Listeners;
      
      use Doctrine\ORM\EntityManager;
      src/PartKeepr/PartBundle/Listeners/CategoryPathListener.php on lines 1..63
      src/PartKeepr/StorageLocationBundle/Listeners/CategoryPathListener.php on lines 1..63

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

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

          initComponent: function ()
          {
      
              this.subGrid = {
                  xtype: 'gridfoo',

        File ProjectReportResultGrid.js has 471 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Ext.define("PartKeepr.Components.Project.ProjectReportResultGrid", {
            extend: "PartKeepr.BaseGrid",
        
            features: [
                {

          Function checkRequirements has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
          Open

              checkRequirements: function ()
              {
                  var i, unit, file, image, distributor;
          
                  var manufacturer = PartKeepr.getApplication().getManufacturerStore().findRecord("name",

          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

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

          <?php
          
          namespace PartKeepr\AuthBundle\Command;
          
          use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
          Severity: Major
          Found in src/PartKeepr/AuthBundle/Command/UnprotectUserCommand.php and 1 other location - About 7 hrs to fix
          src/PartKeepr/AuthBundle/Command/ProtectUserCommand.php on lines 1..36

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

          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

          <?php
          
          namespace PartKeepr\AuthBundle\Command;
          
          use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
          Severity: Major
          Found in src/PartKeepr/AuthBundle/Command/ProtectUserCommand.php and 1 other location - About 7 hrs to fix
          src/PartKeepr/AuthBundle/Command/UnprotectUserCommand.php on lines 1..36

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

          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

          File PartsGrid.js has 456 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * This class is the main part list grid.
           *
           */
          Ext.define('PartKeepr.PartsGrid', {

            Function getAssociatedData has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

                getAssociatedData: function (result, options)
                {
                    var me = this,
                        associations = me.associations,
                        deep, i, item, items, itemData, length,
            Severity: Minor
            Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js - About 6 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

            Severity
            Category
            Status
            Source
            Language