saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

def __virtual__():
    '''
    Provides smartos state provided for SmartOS
    '''
    if 'vmadm.create' in __salt__ and 'imgadm.list' in __salt__:
Severity: Minor
Found in salt/states/smartos.py and 1 other location - About 50 mins to fix
salt/states/zone.py on lines 136..145

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

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

  $.fn.dropdown.noConflict = function () {
    $.fn.dropdown = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 147..150
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 247..250
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 445..448
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 615..618
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1021..1024
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1803..1806
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2136..2139

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

  $.fn.modal.noConflict = function () {
    $.fn.modal = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 147..150
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 247..250
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 445..448
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 615..618
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 782..785
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1803..1806
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2136..2139

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

  $.fn.button.noConflict = function () {
    $.fn.button = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 147..150
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 445..448
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 615..618
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 782..785
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1021..1024
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1803..1806
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2136..2139

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

  $.fn.collapse.noConflict = function () {
    $.fn.collapse = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 147..150
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 247..250
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 445..448
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 782..785
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1021..1024
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1803..1806
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2136..2139

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

  $.fn.carousel.noConflict = function () {
    $.fn.carousel = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 147..150
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 247..250
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 615..618
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 782..785
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1021..1024
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1803..1806
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2136..2139

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

  $.fn.typeahead.noConflict = function () {
    $.fn.typeahead = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 147..150
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 247..250
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 445..448
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 615..618
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 782..785
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1021..1024
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1803..1806

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

  $.fn.tab.noConflict = function () {
    $.fn.tab = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 147..150
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 247..250
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 445..448
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 615..618
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 782..785
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1021..1024
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2136..2139

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

  $.fn.alert.noConflict = function () {
    $.fn.alert = old
    return this
  }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 7 other locations - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 247..250
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 445..448
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 615..618
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 782..785
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1021..1024
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1803..1806
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2136..2139

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

def list_services(profile=None, api_key=None):
    '''
    List services belonging to this account

    CLI Example:
Severity: Major
Found in salt/modules/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_windows(profile=None, api_key=None):
    '''
    List maintenance windows belonging to this account

    CLI Example:
Severity: Major
Found in salt/modules/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_schedules(profile=None, api_key=None):
    '''
    List schedules belonging to this account

    CLI Example:
Severity: Major
Found in salt/modules/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_users(profile=None, api_key=None):
    '''
    List users belonging to this account

    CLI Example:
Severity: Major
Found in salt/runners/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_policies(profile=None, api_key=None):
    '''
    List escalation policies belonging to this account

    CLI Example:
Severity: Major
Found in salt/runners/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116

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

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

def list_services(profile=None, api_key=None):
    '''
    List services belonging to this account

    CLI Example:
Severity: Major
Found in salt/runners/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_windows(profile=None, api_key=None):
    '''
    List maintenance windows belonging to this account

    CLI Example:
Severity: Major
Found in salt/runners/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 125..138

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

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

def list_schedules(profile=None, api_key=None):
    '''
    List schedules belonging to this account

    CLI Example:
Severity: Major
Found in salt/runners/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_users(profile=None, api_key=None):
    '''
    List users belonging to this account

    CLI Example:
Severity: Major
Found in salt/modules/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_policies(profile=None, api_key=None):
    '''
    List escalation policies belonging to this account

    CLI Example:
Severity: Major
Found in salt/modules/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 52..64
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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

def list_incidents(profile=None, api_key=None):
    '''
    List incidents belonging to this account

    CLI Example:
Severity: Major
Found in salt/runners/pagerduty.py and 11 other locations - About 45 mins to fix
salt/modules/pagerduty.py on lines 37..49
salt/modules/pagerduty.py on lines 54..66
salt/modules/pagerduty.py on lines 71..83
salt/modules/pagerduty.py on lines 88..100
salt/modules/pagerduty.py on lines 105..118
salt/modules/pagerduty.py on lines 127..140
salt/runners/pagerduty.py on lines 35..47
salt/runners/pagerduty.py on lines 69..81
salt/runners/pagerduty.py on lines 86..98
salt/runners/pagerduty.py on lines 103..116
salt/runners/pagerduty.py on lines 125..138

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

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