partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

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

        if (PartKeepr.getApplication().getUserPreference("partkeepr.categorytree.showdescriptions") === false) {
            this.showDescriptionsCheckbox.setValue(false);
        } else {
            this.showDescriptionsCheckbox.setValue(true);
        }
src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/TipOfTheDayConfiguration.js on lines 10..14

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

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 (PartKeepr.getApplication().getUserPreference("partkeepr.tipoftheday.showtips") === false) {
            this.displayTipsOnLoginCheckbox.setValue(false);
        } else {
            this.displayTipsOnLoginCheckbox.setValue(true);
        }
src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/DisplayConfiguration.js on lines 12..16

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

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

    initComponent: function ()
    {
        this.callParent(arguments);

        this.importConfiguration = {};

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

        initComponent: function () {
    
            this.defineColumns();
    
            var config = {

      Function toIntArray has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      String.prototype.toIntArray = function() {
        var w1, w2, u, r4 = [], r = [], i = 0;
        var s = this + '\0\0\0'; // pad string to avoid discarding last chars
        var l = s.length - 1;
      
      

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

            initComponent: function () {
                
                var sm = Ext.create('Ext.selection.CheckboxModel',{
                    checkOnly: true
                });

          Method getFilterExpression has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function updateButtonState has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                updateButtonState: function ()
                {
                    var record;
            
                    if (this.getSelection().length !== 1)

              Function _onItemSaved has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _onItemSaved: function ()
                  {
                      this.fireEvent("partSaved", this.record);
              
                      if (this.keepOpenCheckbox.getValue() !== true && this.createCopyCheckbox.getValue() !== true) {

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

                    onSuccess: function (response)
                    {
                        var obj;
                
                        try {
                Severity: Minor
                Found in web/setup/js/SetupTests/AbstractTest.js - About 1 hr to fix

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

                      initComponent: function ()
                      {
                  
                          this.createDatabaseDropdown();
                  
                  
                  Severity: Minor
                  Found in web/setup/js/Cards/DatabaseParametersCard.js - About 1 hr to fix

                    Function createLayout has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        createLayout: function ()
                        {
                            var initialConfig = {
                                values: {
                                    database_driver: "",
                    Severity: Minor
                    Found in web/setup/js/PartKeeprSetup.js - About 1 hr to fix

                      Method __invoke has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __invoke(Request $request)
                          {
                              if ($this->container->hasParameter('partkeepr.auth.allow_password_change') &&
                                  $this->container->getParameter('partkeepr.auth.allow_password_change') === false) {
                                  throw new PasswordChangeNotAllowedException();
                      Severity: Minor
                      Found in src/PartKeepr/AuthBundle/Action/ChangePasswordAction.php - About 1 hr to fix

                        Method testProjectAttachmentRemoval has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

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

                                  this.deleteButton = Ext.create("Ext.button.Button", {
                                      text: i18n('Delete'),
                                      disabled: true,
                                      itemId: 'delete',
                                      scope: this,
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartParameterGrid.js on lines 21..28
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectPartGrid.js on lines 125..132
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectPartGrid.js on lines 134..141
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/UserPreferenceGrid.js on lines 25..32

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

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

                                  this.deleteButton = Ext.create("Ext.button.Button", {
                                      text: i18n('Delete'),
                                      disabled: true,
                                      itemId: 'delete',
                                      scope: this,
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectPartGrid.js on lines 125..132
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectPartGrid.js on lines 134..141
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/AttachmentGrid.js on lines 29..36
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/UserPreferenceGrid.js on lines 25..32

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

                          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

                              setCategoryFilter: function (record) {
                                  var filter = Ext.create("PartKeepr.util.Filter", {
                                      property: 'category',
                                      operator: 'IN',
                                      value: this.getChildrenIds(record)
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Footprint/FootprintNavigation.js on lines 60..69

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

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

                                  this.deleteButton = Ext.create("Ext.button.Button", {
                                      text: i18n('Delete'),
                                      disabled: true,
                                      itemId: 'delete',
                                      scope: this,
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartParameterGrid.js on lines 21..28
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectPartGrid.js on lines 134..141
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/AttachmentGrid.js on lines 29..36
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/UserPreferenceGrid.js on lines 25..32

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

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

                                  this.deleteButton = Ext.create("Ext.button.Button", {
                                      text: i18n('Delete'),
                                      disabled: true,
                                      itemId: 'delete',
                                      scope: this,
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartParameterGrid.js on lines 21..28
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectPartGrid.js on lines 125..132
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectPartGrid.js on lines 134..141
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/AttachmentGrid.js on lines 29..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 59.

                          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

                                      items: [
                                          {
                                              disabled: true,
                                              itemId: "valueField",
                                              xtype: 'textfield',
                          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/FilterExpression.js on lines 67..81

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

                          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