partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

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

    setSystemPreference: function (key, value)
    {
        var record = this.systemPreferenceStore.findRecord("preferenceKey", key);
        value = Ext.encode(value);

src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js on lines 449..466
src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js on lines 71..88
src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js on lines 219..236

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

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

    setUserPreference: function (key, value)
    {
        var record = this.userPreferenceStore.findRecord("preferenceKey", key);
        value = Ext.encode(value);

src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js on lines 401..418
src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js on lines 449..466
src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js on lines 219..236

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

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

    setUserPreference: function (key, value)
    {
        var record = this.userPreferenceStore.findRecord("preferenceKey", key);
        value = Ext.encode(value);

src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js on lines 401..418
src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js on lines 71..88
src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js on lines 219..236

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

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

    setSystemPreference: function (key, value)
    {
        var record = this.systemPreferenceStore.findRecord("preferenceKey", key);
        value = Ext.encode(value);

src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js on lines 401..418
src/PartKeepr/FrontendBundle/Resources/public/js/PartKeepr.js on lines 449..466
src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js on lines 71..88

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

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

    initComponent: function ()
    {
        var modifierItems = [
            {
                xtype: 'checkbox',

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

        moveDown: function ()
        {
            var record, nextRecord, sort, myIndex;
    
            if (this.getSelection().length === 1)
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/ColumnConfigurator/ColumnListGrid.js on lines 239..254

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

    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

        moveUp: function ()
        {
            var record, previousRecord, sort, myIndex;
    
            if (this.getSelection().length === 1)
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/ColumnConfigurator/ColumnListGrid.js on lines 223..238

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

    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 testEqualFilter()
        {
            $client = static::makeClient(true);
    
            $filter = [
    src/PartKeepr/DoctrineReflectionBundle/Tests/AdvancedSearchFilterTest.php on lines 67..102

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

    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 testEqualFilterSame()
        {
            $client = static::makeClient(true);
    
            $filter = [
    src/PartKeepr/DoctrineReflectionBundle/Tests/AdvancedSearchFilterTest.php on lines 30..65

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

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

    Ext.define("PartKeepr.Components.OctoPart.DataApplicator", {
        extend: "Ext.Base",
        mixins: ['Ext.mixin.Observable'],
    
        import: {},

      Function isaac has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

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

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File PartEditor.js has 423 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * @class PartKeepr.PartEditor
      
       * <p>The PartEditor provides an editing form for a part. It contains multiple tabs, one for each nested record.</p>
       */

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

        Ext.define('PartKeepr.PartMeasurementUnitEditorComponent', {
            extend: 'PartKeepr.EditorComponent',
            alias: 'widget.PartMeasurementUnitEditorComponent',
            navigationClass: 'PartKeepr.PartMeasurementUnitGrid',
            editorClass: 'PartKeepr.PartMeasurementUnitEditor',
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/Unit/UnitEditorComponent.js on lines 1..26

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

        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.UnitEditorComponent', {
            extend: 'PartKeepr.EditorComponent',
            alias: 'widget.UnitEditorComponent',
            navigationClass: 'PartKeepr.UnitGrid',
            editorClass: 'PartKeepr.UnitEditor',
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/PartMeasurementUnit/PartMeasurementUnitEditorComponent.js on lines 1..26

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

        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.StorageLocationEditorComponent', {
            extend: 'PartKeepr.EditorComponent',
            alias: 'widget.StorageLocationEditorComponent',
            navigationClass: 'PartKeepr.StorageLocationNavigation',
            editorClass: 'PartKeepr.StorageLocationEditor',
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/Footprint/FootprintEditorComponent.js on lines 1..30

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

        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.FootprintEditorComponent', {
            extend: 'PartKeepr.EditorComponent',
            alias: 'widget.FootprintEditorComponent',
            navigationClass: 'PartKeepr.FootprintNavigation',
            editorClass: 'PartKeepr.FootprintEditor',
        src/PartKeepr/FrontendBundle/Resources/public/js/Components/StorageLocation/StorageLocationEditorComponent.js on lines 1..30

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

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

            getFormWidgets: function () {
                return this.applySizing('formWidgets', {
                    xtype: 'form',
                    id: 'form-widgets',
                    title: 'Form Widgets',

          Function checkRequirements has 151 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function BlobBuilder has 146 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
                    var
                          get_class = function(object) {
                            return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
                        }
            Severity: Major
            Found in src/PartKeepr/FrontendBundle/Resources/public/js/Util/Blob.js - About 5 hrs to fix

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

                  initComponent: function ()
                  {
                      this.store = Ext.create("Ext.data.Store", {
                          model: 'PartKeepr.PartBundle.Entity.PartDistributor',
                          proxy: {
                Severity
                Category
                Status
                Source
                Language