partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

Function crypt_raw has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

bCrypt.prototype.crypt_raw = function(password, salt, log_rounds, cdata, callback, progress) {
    var rounds;
    var j;
    var clen = cdata.length;
    var one_percent;

    Function getBorderLayout has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getBorderLayout: function () {
            var padding = {
                classic: 5,
                partkeepr: 5,
                gray: 5,

      Method massRemoveStockAction has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function massRemoveStockAction(Request $request)
          {
              /**
               * @var IriConverter
               */
      Severity: Minor
      Found in src/PartKeepr/PartBundle/Controller/PartController.php - About 1 hr to fix

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

            initComponent: function ()
            {
                var gridConfig = {
                    xtype: 'partkeepr.StorageLocationGrid',
                    resizable: true,

          Method import has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function import($row, $obj = null)
              {
                  $descriptions = [];
                  switch ($this->importBehaviour) {
                      case self::IMPORTBEHAVIOUR_ALWAYSSETTO:
          Severity: Minor
          Found in src/PartKeepr/ImportBundle/Configuration/ManyToOneConfiguration.php - About 1 hr to fix

            Method getLegacyConfig has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function getLegacyConfig()
                {
                    $config = [];
            
                    $legacyConfig = $this->get('partkeepr.setup.config_service')->legacyConfigParser();

              Function onFieldChange has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  onFieldChange: function (selectionModel, selected)
                  {
                      if (selected.length == 1) {
                          if (selected[0].data.data.type == "field") {
                              this.down("#configurationCards").setActiveItem(this.down("#importerFieldConfiguration"));

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

                  getCheapestDistributor: function (part)
                  {
                      var cheapestDistributor = null;
                      var currentPrice;
                      var activeDistributor;

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

                  save: function (options) {
                      options = Ext.apply({}, options);
              
                      var me = this,
                          phantom = me.phantom,

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

                  extractData: function(root, readOptions) {
              
                      var me = this,
                          entityType = readOptions && readOptions.model ? Ext.data.schema.Schema.lookupEntity(readOptions.model) : me.getModel(),
                          schema = entityType.schema,

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

                  private function getFilterExpression(QueryBuilder $queryBuilder, Filter $filter)
                  {
                      if ($filter->hasSubFilters()) {
                          $subFilterExpressions = [];
              
              

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

                  public function recomputeStockLevels()
                  {
                      $currentStock = 0;
                      $avgPrice = 0;
              
              
              Severity: Minor
              Found in src/PartKeepr/PartBundle/Entity/Part.php - About 1 hr 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 onFlush has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function onFlush(OnFlushEventArgs $eventArgs)
                  {
                      $entityManager = $eventArgs->getEntityManager();
                      $uow = $entityManager->getUnitOfWork();
              
              
              Severity: Minor
              Found in src/PartKeepr/PartBundle/Listeners/StockLevelListener.php - About 1 hr 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 massRemoveStockAction has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function massRemoveStockAction(Request $request)
                  {
                      /**
                       * @var IriConverter
                       */
              Severity: Minor
              Found in src/PartKeepr/PartBundle/Controller/PartController.php - About 1 hr 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 initComponent has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  initComponent: function ()
                  {
              
                      this.loginField = Ext.ComponentMgr.create({
                          xtype: 'textfield',

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

                    public function webcamUploadAction(Request $request)
                    {
                        $file = new TempUploadedFile();
                        $fileService = $this->get('partkeepr_uploadedfile_service');
                
                
                src/PartKeepr/ImageBundle/Controller/TemporaryImageController.php on lines 76..90

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

                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

                    public function webcamUploadAction(Request $request)
                    {
                        $image = new TempImage();
                        $imageService = $this->get('partkeepr_image_service');
                
                
                src/PartKeepr/UploadedFileBundle/Controller/TemporaryFileController.php on lines 106..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 118.

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

                        this.manufacturerFilterCheckbox = Ext.create("Ext.form.field.Checkbox", {
                            width: "20px",
                            listeners: {
                                change: function (obj, value)
                                {
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 284..295
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 802..813
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 858..869

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

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

                        this.distributorFilterCheckbox = Ext.create("Ext.form.field.Checkbox", {
                            width: "20px",
                            listeners: {
                                change: function (obj, value)
                                {
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 284..295
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 746..758
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 858..869

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

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

                        this.footprintFilterCheckbox = Ext.create("Ext.form.field.Checkbox", {
                            width: "20px",
                            listeners: {
                                change: function (obj, value)
                                {
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 284..295
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 746..758
                src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js on lines 802..813

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

                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