partkeepr/PartKeepr

View on GitHub

Showing 922 of 922 total issues

Function onEdit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    onEdit: function (editor, context)
    {
        if (context.field === "distributor" && context.record.getDistributor() !== null)
        {
            var partDistributors = context.record.getPart().distributors();

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

    getFilters: function ()
    {
        var enableFilters = [],
            disableFilters = [],
            filterPlugin;

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

    onPartParameterSelect: function (combo, record) {

        var description = record.get("description");
        if (description !== null) {
            this.down("#description").setRawValue(description);

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

    showLoadMask: function (show, type) {
        if (!type) {
            type = 'default';
        }

Severity: Minor
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Ext.ux.Wizard.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function renderer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    renderer: function (value, metaData, record, rowIndex, colIndex, store, view, renderObj)
    {
        var quantityField = renderObj.getRendererConfigItem(renderObj, "quantityField", false);

        if (record.get("metaPart"))

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

    convertMetaPartsToParts: function (record)
    {
        var missing;

        var i, projectReportItem, subPart;

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

    processCallActionResponse: function (options, success, response, ignoreException, action)
    {
        var i;

        if (success === true) {
Severity: Minor
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraProxy.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function getUserPreference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getUserPreference: function (key, defaultValue)
    {
        var record = this.userPreferenceStore.findRecord("preferenceKey", key);

        if (record) {

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

    onRender: function (ct, position) {

        var image = null;
        var steptxt = this.stepText.split("{stepIndicator}");
        var stepboxs = "\n";
Severity: Minor
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Ext.ux.Wizard.Header.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function import has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function import($preview = false)
    {
        $entities = [];
        $logs = [];

Severity: Minor
Found in src/PartKeepr/ImportBundle/Service/ImporterService.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function getAssociationData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getAssociationData: function ()
    {
        var roleName, values = [], role, item, store;

        for (roleName in this.associations) {
Severity: Minor
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function setAssociationData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    setAssociationData: function (data)
    {
        var setterName, getterName, roleName, store;

        for (roleName in data) {
Severity: Minor
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/CallActions.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function describe has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function describe($entity)
    {
        $accessor = new PropertyAccessor();

        $description = [];
Severity: Minor
Found in src/PartKeepr/ImportBundle/Service/ImporterService.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function getAssociationData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getAssociationData: function ()
    {
        var roleName, values = [], role, item, store;

        for (roleName in this.associations) {
Severity: Minor
Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/CallActions.js - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function import has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function import($row, $obj = null)
    {
        $descriptions = [];
        switch ($this->importBehaviour) {
            case self::IMPORTBEHAVIOUR_ALWAYSIMPORT:
Severity: Minor
Found in src/PartKeepr/ImportBundle/Configuration/EntityConfiguration.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function createReportAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function createReportAction(Request $request)
    {
        /**
         * @var ResourceInterface
         */
Severity: Minor
Found in src/PartKeepr/ProjectBundle/Controller/ProjectReportController.php - About 35 mins 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

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

        scrollingTabs: {
            classic: [310, 150, 20, 960],
            neptune: [325, 150, 20, 1050],
            triton: [325, 150, 20, 1300],
            'neptune-touch': [420, 200, 0, 2880]
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 841..846
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 852..857
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 858..863
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 870..875
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 882..887
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 888..893
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 894..899

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

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

        progressBar: {
            classic: [450, 200, 660, 1020],
            neptune: [500, 200, 690, 1110],
            triton: [500, 220, 690, 1310],
            'neptune-touch': [790, 340, 0, 3100]
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 841..846
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 852..857
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 858..863
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 864..869
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 870..875
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 888..893
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 894..899

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

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

        grid: {
            classic: [450, 200, 660, 560],
            neptune: [500, 200, 690, 650],
            triton: [500, 300, 690, 650],
            'neptune-touch': [790, 400, 0, 2100]
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 841..846
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 858..863
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 864..869
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 870..875
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 882..887
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 888..893
src/PartKeepr/FrontendBundle/Resources/public/js/Components/ThemeTester/ThemeTester.js on lines 894..899

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

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

        {
            operator: "like",
            symbol: "%%",
            description: i18n("Matches a subtext with wildcards (%)"),
            type: 'scalar',
src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/OperatorStore.js on lines 72..81
src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/OperatorStore.js on lines 82..91
src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/OperatorStore.js on lines 92..101
src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/OperatorStore.js on lines 102..111
src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/OperatorStore.js on lines 112..121
src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/OperatorStore.js on lines 122..131
src/PartKeepr/FrontendBundle/Resources/public/js/Data/store/OperatorStore.js on lines 131..140

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

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