saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

        if self.opts.get('rotate_aes_key'):
            salt.crypt.dropfile(self.opts['cachedir'], self.opts['user'])
Severity: Major
Found in salt/key.py and 3 other locations - About 1 hr to fix
salt/key.py on lines 724..725
salt/key.py on lines 766..767
salt/key.py on lines 807..808

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

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

            if 'error' in result_delete_pipeline:
                ret['result'] = False
                ret['comment'] = 'Failed to delete data pipeline {0}: {1}'.format(
                    pipeline_id, result_delete_pipeline['error'])
                return ret
Severity: Major
Found in salt/states/boto_datapipeline.py and 10 other locations - About 1 hr to fix
salt/states/boto_apigateway.py on lines 1771..1774
salt/states/boto_apigateway.py on lines 1806..1809
salt/states/boto_cloudfront.py on lines 133..139
salt/states/boto_cloudfront.py on lines 158..164
salt/states/boto_cloudfront.py on lines 226..232
salt/states/boto_datapipeline.py on lines 150..154
salt/states/boto_datapipeline.py on lines 192..196
salt/states/boto_datapipeline.py on lines 211..216
salt/states/boto_datapipeline.py on lines 225..229
salt/states/boto_s3.py on lines 298..304

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

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

        if 'error' in res:
            ret['result'] = False
            ret['comment'] = 'Error creating distribution {0}: {1}'.format(
                name,
                res['error'],
Severity: Major
Found in salt/states/boto_cloudfront.py and 10 other locations - About 1 hr to fix
salt/states/boto_apigateway.py on lines 1771..1774
salt/states/boto_apigateway.py on lines 1806..1809
salt/states/boto_cloudfront.py on lines 133..139
salt/states/boto_cloudfront.py on lines 226..232
salt/states/boto_datapipeline.py on lines 150..154
salt/states/boto_datapipeline.py on lines 178..182
salt/states/boto_datapipeline.py on lines 192..196
salt/states/boto_datapipeline.py on lines 211..216
salt/states/boto_datapipeline.py on lines 225..229
salt/states/boto_s3.py on lines 298..304

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

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

        if 'error' in res:
            ret['result'] = False
            ret['comment'] = 'Error updating distribution {0}: {1}'.format(
                name,
                res['error'],
Severity: Major
Found in salt/states/boto_cloudfront.py and 10 other locations - About 1 hr to fix
salt/states/boto_apigateway.py on lines 1771..1774
salt/states/boto_apigateway.py on lines 1806..1809
salt/states/boto_cloudfront.py on lines 133..139
salt/states/boto_cloudfront.py on lines 158..164
salt/states/boto_datapipeline.py on lines 150..154
salt/states/boto_datapipeline.py on lines 178..182
salt/states/boto_datapipeline.py on lines 192..196
salt/states/boto_datapipeline.py on lines 211..216
salt/states/boto_datapipeline.py on lines 225..229
salt/states/boto_s3.py on lines 298..304

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

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

            if 'error' in result_create_pipeline:
                ret['result'] = False
                ret['comment'] = 'Failed to create data pipeline {0}: {1}'.format(
                    name, result_create_pipeline['error'])
                return ret
Severity: Major
Found in salt/states/boto_datapipeline.py and 10 other locations - About 1 hr to fix
salt/states/boto_apigateway.py on lines 1771..1774
salt/states/boto_apigateway.py on lines 1806..1809
salt/states/boto_cloudfront.py on lines 133..139
salt/states/boto_cloudfront.py on lines 158..164
salt/states/boto_cloudfront.py on lines 226..232
salt/states/boto_datapipeline.py on lines 150..154
salt/states/boto_datapipeline.py on lines 178..182
salt/states/boto_datapipeline.py on lines 211..216
salt/states/boto_datapipeline.py on lines 225..229
salt/states/boto_s3.py on lines 298..304

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

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

            if 'error' in result:
                ret['result'] = False
                ret['comment'] = 'Failed to update a usage plan {0}, {1}'.format(plan_name, result['error'])
                return ret
Severity: Major
Found in salt/states/boto_apigateway.py and 10 other locations - About 1 hr to fix
salt/states/boto_apigateway.py on lines 1771..1774
salt/states/boto_cloudfront.py on lines 133..139
salt/states/boto_cloudfront.py on lines 158..164
salt/states/boto_cloudfront.py on lines 226..232
salt/states/boto_datapipeline.py on lines 150..154
salt/states/boto_datapipeline.py on lines 178..182
salt/states/boto_datapipeline.py on lines 192..196
salt/states/boto_datapipeline.py on lines 211..216
salt/states/boto_datapipeline.py on lines 225..229
salt/states/boto_s3.py on lines 298..304

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

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

    if 'error' in r:
        ret['result'] = False
        ret['comment'] = 'Failed to {0} S3 object: {1}.'.format(
            action,
            r['error'],
Severity: Major
Found in salt/states/boto_s3.py and 10 other locations - About 1 hr to fix
salt/states/boto_apigateway.py on lines 1771..1774
salt/states/boto_apigateway.py on lines 1806..1809
salt/states/boto_cloudfront.py on lines 133..139
salt/states/boto_cloudfront.py on lines 158..164
salt/states/boto_cloudfront.py on lines 226..232
salt/states/boto_datapipeline.py on lines 150..154
salt/states/boto_datapipeline.py on lines 178..182
salt/states/boto_datapipeline.py on lines 192..196
salt/states/boto_datapipeline.py on lines 211..216
salt/states/boto_datapipeline.py on lines 225..229

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

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

        if self.opts.get('rotate_aes_key'):
            salt.crypt.dropfile(self.opts['cachedir'], self.opts['user'])
Severity: Major
Found in salt/key.py and 3 other locations - About 1 hr to fix
salt/key.py on lines 766..767
salt/key.py on lines 807..808
salt/key.py on lines 839..840

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

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

        requested_levels = set(kwargs['runlevels'] if isinstance(kwargs['runlevels'],
                                                                 list) else [kwargs['runlevels']])
Severity: Major
Found in salt/modules/gentoo_service.py and 2 other locations - About 1 hr to fix
salt/modules/gentoo_service.py on lines 322..323
salt/modules/gentoo_service.py on lines 347..348

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

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

    def __setstate__(self, state):
        self._is_child = True
        self.__init__(
            state['opts'],
            log_queue=state['log_queue'],
Severity: Major
Found in salt/master.py and 5 other locations - About 1 hr to fix
salt/master.py on lines 802..807
salt/utils/event.py on lines 1099..1104
salt/utils/event.py on lines 1230..1235
salt/utils/master.py on lines 529..534
salt/utils/master.py on lines 592..597

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

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

    requested_levels = set(kwargs['runlevels'] if isinstance(kwargs['runlevels'],
                                                             list) else [kwargs['runlevels']])
Severity: Major
Found in salt/modules/gentoo_service.py and 2 other locations - About 1 hr to fix
salt/modules/gentoo_service.py on lines 291..292
salt/modules/gentoo_service.py on lines 322..323

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

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

    def __setstate__(self, state):
        self._is_child = True
        self.__init__(
            state['opts'],
            log_queue=state['log_queue'],
Severity: Major
Found in salt/utils/event.py and 5 other locations - About 1 hr to fix
salt/master.py on lines 164..169
salt/master.py on lines 802..807
salt/utils/event.py on lines 1099..1104
salt/utils/master.py on lines 529..534
salt/utils/master.py on lines 592..597

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

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

        requested_levels = set(kwargs['runlevels'] if isinstance(kwargs['runlevels'],
                                                                 list) else [kwargs['runlevels']])
Severity: Major
Found in salt/modules/gentoo_service.py and 2 other locations - About 1 hr to fix
salt/modules/gentoo_service.py on lines 291..292
salt/modules/gentoo_service.py on lines 347..348

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

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

CreateDataType('vim.cluster.StoragePolicyStatus', 'VsanStoragePolicyStatus', 'vmodl.DynamicData', 'vim.version.version9', [('id', 'string', 'vim.version.version9', 0 | F_OPTIONAL), ('expectedValue', 'string', 'vim.version.version9', 0 | F_OPTIONAL), ('currentValue', 'string', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 5 other locations - About 1 hr to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 24..24
salt/ext/vsan/vsanmgmtObjects.py on lines 38..38
salt/ext/vsan/vsanmgmtObjects.py on lines 95..95
salt/ext/vsan/vsanmgmtObjects.py on lines 103..103
salt/ext/vsan/vsanmgmtObjects.py on lines 120..120

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

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

CreateDataType('vim.cluster.VsanClusterVmdkLoadTestResult', 'VsanClusterVmdkLoadTestResult', 'vmodl.DynamicData', 'vim.version.version9', [('task', 'vim.Task', 'vim.version.version9', 0 | F_OPTIONAL), ('clusterResult', 'vim.cluster.VsanClusterProactiveTestResult', 'vim.version.version9', 0 | F_OPTIONAL), ('hostResults', 'vim.host.VsanHostVmdkLoadTestResult[]', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 5 other locations - About 1 hr to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 24..24
salt/ext/vsan/vsanmgmtObjects.py on lines 30..30
salt/ext/vsan/vsanmgmtObjects.py on lines 38..38
salt/ext/vsan/vsanmgmtObjects.py on lines 95..95
salt/ext/vsan/vsanmgmtObjects.py on lines 103..103

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

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

    def __setstate__(self, state):
        self._is_child = True
        self.__init__(
            state['opts'],
            log_queue=state['log_queue'],
Severity: Major
Found in salt/utils/event.py and 5 other locations - About 1 hr to fix
salt/master.py on lines 164..169
salt/master.py on lines 802..807
salt/utils/event.py on lines 1230..1235
salt/utils/master.py on lines 529..534
salt/utils/master.py on lines 592..597

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

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

CreateDataType('vim.host.VsanRepairObjectsResult', 'VsanRepairObjectsResult', 'vmodl.DynamicData', 'vim.version.version9', [('inQueueObjects', 'string[]', 'vim.version.version9', 0 | F_OPTIONAL), ('failedRepairObjects', 'vim.host.VsanFailedRepairObjectResult[]', 'vim.version.version9', 0 | F_OPTIONAL), ('notInQueueObjects', 'string[]', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 5 other locations - About 1 hr to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 24..24
salt/ext/vsan/vsanmgmtObjects.py on lines 30..30
salt/ext/vsan/vsanmgmtObjects.py on lines 95..95
salt/ext/vsan/vsanmgmtObjects.py on lines 103..103
salt/ext/vsan/vsanmgmtObjects.py on lines 120..120

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

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

CreateDataType('vim.cluster.VsanClusterHclInfo', 'VsanClusterHclInfo', 'vmodl.DynamicData', 'vim.version.version9', [('hclDbLastUpdate', 'vmodl.DateTime', 'vim.version.version9', 0 | F_OPTIONAL), ('hclDbAgeHealth', 'string', 'vim.version.version9', 0 | F_OPTIONAL), ('hostResults', 'vim.host.VsanHostHclInfo[]', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 5 other locations - About 1 hr to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 30..30
salt/ext/vsan/vsanmgmtObjects.py on lines 38..38
salt/ext/vsan/vsanmgmtObjects.py on lines 95..95
salt/ext/vsan/vsanmgmtObjects.py on lines 103..103
salt/ext/vsan/vsanmgmtObjects.py on lines 120..120

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

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

CreateDataType('vim.host.VsanQueryResultHostInfo', 'VsanQueryResultHostInfo', 'vmodl.DynamicData', 'vim.version.version9', [('uuid', 'string', 'vim.version.version9', 0 | F_OPTIONAL), ('hostnameInCmmds', 'string', 'vim.version.version9', 0 | F_OPTIONAL), ('vsanIpv4Addresses', 'string[]', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 5 other locations - About 1 hr to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 24..24
salt/ext/vsan/vsanmgmtObjects.py on lines 30..30
salt/ext/vsan/vsanmgmtObjects.py on lines 38..38
salt/ext/vsan/vsanmgmtObjects.py on lines 103..103
salt/ext/vsan/vsanmgmtObjects.py on lines 120..120

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

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

CreateDataType('vim.host.VsanHostCimProviderInfo', 'VsanHostCimProviderInfo', 'vmodl.DynamicData', 'vim.version.version9', [('cimProviderSupported', 'boolean', 'vim.version.version9', 0 | F_OPTIONAL), ('installedCIMProvider', 'string', 'vim.version.version9', 0 | F_OPTIONAL), ('cimProviderOnHcl', 'string[]', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 5 other locations - About 1 hr to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 24..24
salt/ext/vsan/vsanmgmtObjects.py on lines 30..30
salt/ext/vsan/vsanmgmtObjects.py on lines 38..38
salt/ext/vsan/vsanmgmtObjects.py on lines 95..95
salt/ext/vsan/vsanmgmtObjects.py on lines 120..120

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

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