partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

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

    initComponent: function ()
    {
        this.iconComponent = Ext.create('Ext.Component', {
            baseCls: Ext.baseCSSPrefix + 'message-box-icon' + " " + Ext.baseCSSPrefix + 'message-box-error'
        });

    Function getLegacyConfig has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

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

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

    var isaac = (function(){
    
      /* private: internal states */
      var m = Array(256), // internal memory
          acc = 0,        // accumulator
    Severity: Major
    Found in src/PartKeepr/FrontendBundle/Resources/public/js/Util/Crypto/isaac.js - About 4 hrs to fix

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

          onFileUploaded: function (data)
          {
              var uploadedFile = Ext.create("PartKeepr.UploadedFileBundle.Entity.TempUploadedFile", data);
      
              if (this.record.getImage() === null) {
      src/PartKeepr/FrontendBundle/Resources/public/js/Components/Footprint/FootprintEditor.js on lines 66..76

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

      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

          onFileUploaded: function (data) {
              var uploadedFile = Ext.create("PartKeepr.UploadedFileBundle.Entity.TempUploadedFile", data);
      
              if (this.record.getImage() === null) {
                  this.record.setImage(data);
      src/PartKeepr/FrontendBundle/Resources/public/js/Components/StorageLocation/StorageLocationEditor.js on lines 101..112

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

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

          renderCell: function (column, record, recordIndex, rowIndex, columnIndex, out) {
              var me = this,
                  fullIndex,
                  selModel = me.selectionModel,
                  cellValues = me.cellValues,

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

          public function __invoke(Request $request, $id)
          {
              list($resourceType) = $this->extractAttributes($request);
      
              /**
      Severity: Minor
      Found in src/PartKeepr/BatchJobBundle/Action/ExecuteBatchJobAction.php - About 4 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 initComponent has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          initComponent: function ()
          {
      
              this.infoGrid = Ext.create("PartKeepr.Components.Part.PartInfoGrid", {
                  mode: 'short',

        File ImporterManyToOneConfiguration.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Ext.define("PartKeepr.Importer.ImporterManyToOneConfiguration", {
            extend: "Ext.form.Panel",
            layout: {
                type: 'vbox',
                align: 'stretch'

          PartParameter has 32 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class PartParameter extends BaseEntity
          {
              const VALUE_TYPE_STRING = 'string';
          
              const VALUE_TYPE_NUMERIC = 'numeric';
          Severity: Minor
          Found in src/PartKeepr/PartBundle/Entity/PartParameter.php - About 4 hrs to fix

            User has 32 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class User extends BaseEntity implements UserInterface, EquatableInterface
            {
                /**
                 * @ORM\Column(length=50)
                 * @Groups({"default"})
            Severity: Minor
            Found in src/PartKeepr/AuthBundle/Entity/User.php - About 4 hrs to fix

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

                  displayNextTip: function ()
                  {
                      var idx = this.tipStore.indexOf(this.currentTip);
                      this.currentTip = this.tipStore.getAt(idx + 1);
              
              
              src/PartKeepr/FrontendBundle/Resources/public/js/Components/TipOfTheDay/TipOfTheDayWindow.js on lines 117..126

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

              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

                  onFailure: function (response) {
                      this.success = false;
                      this.resultMessage = "Web Server misconfiguration";
                      this.errors = ['Web Server Configuration error. Please read our <a href="https://wiki.partkeepr.org/wiki/KB00005:Web_Server_Configuration" target="_blank">wiki about the proper web server configuration</a>', response.responseText];
                      this.errors.push('Error 2: Tried to retrieve setup/webserver-test and it did not succeed.');
              Severity: Major
              Found in web/setup/js/SetupTests/WebserverRewriteTest.js and 1 other location - About 4 hrs to fix
              web/setup/js/SetupTests/WebserverTest.js on lines 9..21

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

              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

                  displayPreviousTip: function ()
                  {
                      var idx = this.tipStore.indexOf(this.currentTip);
                      this.currentTip = this.tipStore.getAt(idx - 1);
              
              
              src/PartKeepr/FrontendBundle/Resources/public/js/Components/TipOfTheDay/TipOfTheDayWindow.js on lines 130..139

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

              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

                      for (i = 0; i < this.batchJob.batchJobUpdateFields().getCount(); i++) {
                          updateFieldConfig.push({
                              property: this.batchJob.batchJobUpdateFields().getAt(i).get("property"),
                              value: this.batchJob.batchJobUpdateFields().getAt(i).get("value")
                          });
              src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobExecutionWindow.js on lines 163..168

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

              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

                  onFailure: function (response) {
                      this.success = false;
                      this.resultMessage = "Web Server misconfiguration";
                      this.errors = ['Web Server Configuration error. Please read our <a href="https://wiki.partkeepr.org/wiki/KB00005:Web_Server_Configuration" target="_blank">wiki about the proper web server configuration</a>', response.responseText];
                      this.errors.push('Error 1: Tried to send a POST request to setup/webserverTest and it did not succeed.');
              Severity: Major
              Found in web/setup/js/SetupTests/WebserverTest.js and 1 other location - About 4 hrs to fix
              web/setup/js/SetupTests/WebserverRewriteTest.js on lines 10..23

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

              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

                      for (i = 0; i < this.batchJob.batchJobQueryFields().getCount(); i++) {
                          queryFieldConfig.push({
                              property: this.batchJob.batchJobQueryFields().getAt(i).get("property"),
                              value: this.batchJob.batchJobQueryFields().getAt(i).get("value")
                          });
              src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobExecutionWindow.js on lines 170..175

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

              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 (property_exists($importConfiguration, "manytoone")) {
                          foreach ($importConfiguration->manytoone as $manyToOne => $configuration) {
                              if ($this->classMetadata->hasAssociation($manyToOne)) {
                                  $targetClass = $this->classMetadata->getAssociationTargetClass($manyToOne);
                                  $cm = $this->em->getClassMetadata($targetClass);
              Severity: Major
              Found in src/PartKeepr/ImportBundle/Configuration/Configuration.php and 1 other location - About 4 hrs to fix
              src/PartKeepr/ImportBundle/Configuration/Configuration.php on lines 75..97

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

              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 (property_exists($importConfiguration, "onetomany")) {
                          foreach ($importConfiguration->onetomany as $oneToMany => $configuration) {
                              if ($this->classMetadata->hasAssociation($oneToMany)) {
                                  $targetClass = $this->classMetadata->getAssociationTargetClass($oneToMany);
                                  $cm = $this->em->getClassMetadata($targetClass);
              Severity: Major
              Found in src/PartKeepr/ImportBundle/Configuration/Configuration.php and 1 other location - About 4 hrs to fix
              src/PartKeepr/ImportBundle/Configuration/Configuration.php on lines 49..73

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

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

                  initComponent: function ()
                  {
              
                      this.groupingFeature = Ext.create('Ext.grid.feature.Grouping', {
                          //enableGroupingMenu: false,
                Severity
                Category
                Status
                Source
                Language