partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

Function createFilterFields has 804 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    createFilterFields: function ()
    {

        // Create the storage location filter field
        this.storageLocationFilter = Ext.create("PartKeepr.StorageLocationComboBox", {

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

        statics: {
            actionName: i18n("Add/Remove Stock"),
            actionDescription: i18n("Searches for a part and then allows the user to increase/decrease the stock level"),
            configure: function (configuration)
            {
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/BarcodeScanner/Actions/SearchPart.js on lines 4..109

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

    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

        statics: {
            actionName: i18n("Search Part"),
            actionDescription: i18n("Searches for a part in the parts list"),
            configure: function (configuration)
            {
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/BarcodeScanner/Actions/AddRemoveStock.js on lines 4..109

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

    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 PartFilterPanel.js has 994 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Defines the part filter panel.
     *
     *
     */

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

              if (this.searchFieldSystemPreference !== null) {
                  var fields = PartKeepr.getApplication().getSystemPreference(this.searchFieldSystemPreference,
                      this.searchFieldSystemPreferenceDefaults);
      
                  if (splitTerms === true) {
      src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/BaseStore.js on lines 82..133

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

      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 (this.searchFieldSystemPreference !== null) {
                  var fields = PartKeepr.getApplication().getSystemPreference(this.searchFieldSystemPreference,
                      this.searchFieldSystemPreferenceDefaults);
      
                  if (splitTerms === true) {
      src/PartKeepr/FrontendBundle/Resources/public/js/form/field/SearchField.js on lines 149..200

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

      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 ThemeTester.js has 943 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Ext.define("PartKeepr.ThemeTester", {
          extend: "Ext.panel.Panel",
          scrollable: true,
      
          initComponent: function () {

        Function createFilterFields has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
        Open

            createFilterFields: function ()
            {
        
                // Create the storage location filter field
                this.storageLocationFilter = Ext.create("PartKeepr.StorageLocationComboBox", {

        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

        Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartManufacturerFields', {
            extend: 'PartKeepr.Components.Preferences.PreferenceEditor',
        
            initComponent: function ()
            {
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartDistributorFields.js on lines 1..51

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

        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

        Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartDistributorFields', {
            extend: 'PartKeepr.Components.Preferences.PreferenceEditor',
        
            initComponent: function ()
            {
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartManufacturerFields.js on lines 1..51

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

        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

            execute: function ()
            {
                this.searchStore = Ext.create("Ext.data.Store", {
                    model: 'PartKeepr.PartBundle.Entity.Part',
                    autoLoad: false,
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/BarcodeScanner/Actions/AddRemoveStock.js on lines 111..152

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

        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

            execute: function ()
            {
                this.searchStore = Ext.create("Ext.data.Store", {
                    model: 'PartKeepr.PartBundle.Entity.Part',
                    autoLoad: false,
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/BarcodeScanner/Actions/AddPart.js on lines 119..160

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

        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

        Ext.define("PartKeepr.StorageLocationTree", {
            extend: 'PartKeepr.CategoryEditorTree',
            alias: 'widget.StorageLocationTree',
            xtype: 'partkeepr.StorageLocationTree',
            viewConfig: {
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/Footprint/FootprintTree.js on lines 1..49

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

        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

        Ext.define("PartKeepr.FootprintTree", {
            extend: 'PartKeepr.CategoryEditorTree',
            alias: 'widget.FootprintTree',
            xtype: 'partkeepr.FootprintTree',
            viewConfig: {
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/StorageLocation/StorageLocationTree.js on lines 1..48

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

        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

            onActivate: function () {
                this.initial = true;
                this.hostname.setValue(PartKeeprSetup.getApplication().getSetupConfig().values.database_host);
                this.username.setValue(PartKeeprSetup.getApplication().getSetupConfig().values.database_user);
                this.password.setValue(PartKeeprSetup.getApplication().getSetupConfig().values.database_password);
        Severity: Major
        Found in web/setup/js/Cards/DatabaseParametersCard.MySQL.js and 1 other location - About 1 day to fix
        web/setup/js/Cards/DatabaseParametersCard.PostgreSQL.js on lines 169..184

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

        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

            onActivate: function ()
            {
                this.initial = true;
                this.hostname.setValue(PartKeeprSetup.getApplication().getSetupConfig().values.database_host);
                this.username.setValue(PartKeeprSetup.getApplication().getSetupConfig().values.database_user);
        Severity: Major
        Found in web/setup/js/Cards/DatabaseParametersCard.PostgreSQL.js and 1 other location - About 1 day to fix
        web/setup/js/Cards/DatabaseParametersCard.MySQL.js on lines 174..187

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

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

            initComponent: function ()
            {
                // Defines the overall height of all fields, used to calculate the anchoring for the description field
                var overallHeight = (this.partMode == "create") ? 320: 265;
        
        

          File PartKeepr.js has 607 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          Ext.namespace('PartKeepr');
          
          PartKeepr.application = null;
          
          Ext.application({
          Severity: Major
          Found in src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js - About 1 day to fix

            Function applyData has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

                applyData: function ()
                {
                    var spec, i, unit, value, siPrefix, distributor, j, partDistributor, currency, k, found;
            
                    if (this.waitMessage instanceof Ext.window.MessageBox)

            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

            Part has 68 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Part extends BaseEntity
            {
                /**
                 * The category of the part.
                 *
            Severity: Major
            Found in src/PartKeepr/PartBundle/Entity/Part.php - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language