CiscoUcs/imcsdk

View on GitHub
imcsdk/mometa/aaa/AaaUser.py

Summary

Maintainability
C
1 day
Test Coverage

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

    def __init__(self, parent_mo_or_dn, id, **kwargs):
        self._dirty_mask = 0
        self.id = id
        self.account_status = None
        self.admin_action = None
Severity: Major
Found in imcsdk/mometa/aaa/AaaUser.py and 7 other locations - About 4 hrs to fix
imcsdk/mometa/kmip/KmipServer.py on lines 85..96
imcsdk/mometa/lsboot/LsbootSd.py on lines 90..101
imcsdk/mometa/lsboot/LsbootVMedia.py on lines 98..109
imcsdk/mometa/memory/MemoryPersistentMemoryNamespace.py on lines 92..103
imcsdk/mometa/pci/PciLink.py on lines 57..68
imcsdk/mometa/power/PowerMonitor.py on lines 84..95
imcsdk/mometa/storage/StorageUnusedLocalDisk.py on lines 84..95

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

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

    mo_meta = {
        "classic": MoMeta("AaaUser", "aaaUser", "user-[id]", VersionMeta.Version151f, "InputOutput", 0x3ff, [], ["admin", "read-only", "user"], ['aaaUserEp'], ['aaaUserSSHKey'], ["Get", "Set"]),
        "modular": MoMeta("AaaUser", "aaaUser", "user-[id]", VersionMeta.Version2013e, "InputOutput", 0x3ff, [], ["admin", "read-only", "user"], ['aaaUserEp'], ['aaaUserSSHKey'], ["Get", "Set"])
Severity: Major
Found in imcsdk/mometa/aaa/AaaUser.py and 6 other locations - About 3 hrs to fix
imcsdk/mometa/bios/BiosProfile.py on lines 27..29
imcsdk/mometa/comm/CommMailAlert.py on lines 23..25
imcsdk/mometa/event/EventManagement.py on lines 18..20
imcsdk/mometa/storage/StorageFlexFlashVirtualDrive.py on lines 22..24
imcsdk/mometa/storage/StorageRaidBattery.py on lines 20..22
imcsdk/mometa/sysdebug/SysdebugMEpLog.py on lines 28..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 65.

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

    prop_map = {

        "classic": {
            "accountStatus": "account_status", 
            "adminAction": "admin_action", 
Severity: Major
Found in imcsdk/mometa/aaa/AaaUser.py and 13 other locations - About 2 hrs to fix
imcsdk/mometa/aaa/AaaUserPolicy.py on lines 55..80
imcsdk/mometa/adaptor/AdaptorConnectorInfo.py on lines 54..79
imcsdk/mometa/adaptor/AdaptorEthRdmaProfile.py on lines 59..84
imcsdk/mometa/comm/CommKvm.py on lines 54..79
imcsdk/mometa/ip/IpFiltering.py on lines 58..83
imcsdk/mometa/kmip/KmipServer.py on lines 55..80
imcsdk/mometa/lsboot/LsbootDevPrecision.py on lines 70..95
imcsdk/mometa/lsboot/LsbootSd.py on lines 60..85
imcsdk/mometa/lsboot/LsbootVMedia.py on lines 68..93
imcsdk/mometa/memory/MemoryPersistentMemoryNamespace.py on lines 62..87
imcsdk/mometa/storage/StorageUnusedLocalDisk.py on lines 54..79
imcsdk/mometa/upload/UploadBiosProfile.py on lines 59..84
imcsdk/mometa/upload/UploadPIDCatalog.py on lines 59..84

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

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

There are no issues that match your filters.

Category
Status