partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

File Part.php has 408 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace PartKeepr\PartBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
Severity: Minor
Found in src/PartKeepr/PartBundle/Entity/Part.php - About 5 hrs to fix

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

            if (this.import.images)
            {
                if (this.data['best_image'])
                {
                    image = this.data.best_image;
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js on lines 138..157
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js on lines 159..176

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

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

            if (this.import.bestDatasheet)
            {
                if (this.data['best_datasheet'])
                {
                    file = this.data.best_datasheet;
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js on lines 159..176
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js on lines 197..216

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

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

            if (this.import.cadModels)
            {
                if (this.data['cad'])
                {
                    file = this.data.cad;
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js on lines 138..157
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js on lines 197..216

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

    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

        renderer: function (value, metaData, record, rowIndex, colIndex, store, view, renderObj)
        {
            var i;
            var partParameterName = renderObj.getRendererConfigItem(renderObj, "parameterName", false);
    
    
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/Renderers/ProjectPartParameterRenderer.js on lines 6..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 145.

    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

        onEntitySelectClick: function ()
        {
            this.entitySelector = Ext.create("Ext.window.Window", {
                items: Ext.create("PartKeepr.Widgets.EntityPicker", {
                    model: this.selectedField.data.data.reference,
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobUpdateExpression.js on lines 129..150

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

    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

        onEntitySelectClick: function ()
        {
            this.entitySelector = Ext.create("Ext.window.Window", {
                items: Ext.create("PartKeepr.Widgets.EntityPicker", {
                    model: this.selectedField.data.data.reference,
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/FilterExpression.js on lines 266..287

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

    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

        renderer: function (value, metaData, record, rowIndex, colIndex, store, view, renderObj)
        {
            var i;
            var partParameterName = renderObj.getRendererConfigItem(renderObj, "parameterName", false);
    
    
    src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Renderers/PartParameterRenderer.js on lines 6..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 145.

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

        initComponent: function ()
        {
            this.store = Ext.create("Ext.data.Store", {
                fields: [
                    {name: 'title', type: 'string'},

      Function applyData has 136 lines of code (exceeds 25 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)

        Function validateConfigNode has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            validateConfigNode: function (node)
            {
                var configuration = node.data.data.configuration;
                var recurse = false;
        
        

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

            initComponent: function ()
            {
                this.createHintTemplate = Ext.create("Ext.Template", [
                    "CREATE DATABASE {name} CHARACTER SET UTF8;\nGRANT USAGE ON *.* TO {user}@{localhost} IDENTIFIED BY '{password}';\nGRANT ALL PRIVILEGES ON {name}.* TO {user}@{localhost};"
                ]);
        Severity: Major
        Found in web/setup/js/Cards/DatabaseParametersCard.MySQL.js - About 5 hrs to fix

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

          Ext.define('PartKeepr.BatchJobEditorComponent', {
              extend: 'PartKeepr.EditorComponent',
              alias: 'widget.BatchJobEditorComponent',
              navigationClass: 'PartKeepr.BatchJobGrid',
              editorClass: 'PartKeepr.BatchJobEditor',
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Distributor/DistributorEditorComponent.js on lines 1..24
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Manufacturer/ManufacturerEditorComponent.js on lines 1..27

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

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

          Ext.define('PartKeepr.DistributorEditorComponent', {
              extend: 'PartKeepr.EditorComponent',
              alias: 'widget.DistributorEditorComponent',
              navigationClass: 'PartKeepr.DistributorGrid',
              editorClass: 'PartKeepr.DistributorEditor',
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobEditorComponent.js on lines 1..24
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Manufacturer/ManufacturerEditorComponent.js on lines 1..27

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

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

          Ext.define('PartKeepr.ManufacturerEditorComponent', {
              extend: 'PartKeepr.EditorComponent',
              alias: 'widget.ManufacturerEditorComponent',
              navigationClass: 'PartKeepr.ManufacturerGrid',
              editorClass: 'PartKeepr.ManufacturerEditor',
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/BatchJob/BatchJobEditorComponent.js on lines 1..24
          src/PartKeepr/FrontendBundle/Resources/public/js/Components/Distributor/DistributorEditorComponent.js on lines 1..24

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

          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

          <?php
          
          namespace PartKeepr\SetupBundle\Controller;
          
          use Symfony\Component\HttpFoundation\JsonResponse;
          src/PartKeepr/SetupBundle/Controller/FootprintSetupController.php on lines 1..49
          src/PartKeepr/SetupBundle/Controller/SiPrefixSetupController.php on lines 1..51
          src/PartKeepr/SetupBundle/Controller/UnitSetupController.php 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 185.

          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

          <?php
          
          namespace PartKeepr\SetupBundle\Controller;
          
          use Symfony\Component\HttpFoundation\JsonResponse;
          src/PartKeepr/SetupBundle/Controller/FootprintSetupController.php on lines 1..49
          src/PartKeepr/SetupBundle/Controller/ManufacturerSetupController.php on lines 1..51
          src/PartKeepr/SetupBundle/Controller/UnitSetupController.php 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 185.

          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

          <?php
          
          namespace PartKeepr\SetupBundle\Controller;
          
          use Symfony\Component\HttpFoundation\JsonResponse;
          src/PartKeepr/SetupBundle/Controller/ManufacturerSetupController.php on lines 1..51
          src/PartKeepr/SetupBundle/Controller/SiPrefixSetupController.php on lines 1..51
          src/PartKeepr/SetupBundle/Controller/UnitSetupController.php 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 185.

          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

          <?php
          
          namespace PartKeepr\SetupBundle\Controller;
          
          use Symfony\Component\HttpFoundation\JsonResponse;
          src/PartKeepr/SetupBundle/Controller/FootprintSetupController.php on lines 1..49
          src/PartKeepr/SetupBundle/Controller/ManufacturerSetupController.php on lines 1..51
          src/PartKeepr/SetupBundle/Controller/SiPrefixSetupController.php 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 185.

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

              initComponent: function ()
              {
                  this.createHintTemplate = Ext.create("Ext.Template", [
                      "<code>CREATE USER {user} WITH UNENCRYPTED PASSWORD '{password}'; CREATE DATABASE {dbname}; GRANT ALL PRIVILEGES ON DATABASE {dbname} TO {user};<br/><br/></code>"
                  ]);
          Severity: Major
          Found in web/setup/js/Cards/DatabaseParametersCard.PostgreSQL.js - About 5 hrs to fix
            Severity
            Category
            Status
            Source
            Language