modxcms/revolution

View on GitHub

Showing 7,873 of 7,873 total issues

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

            if(nextFocus){
                (function(){
                    nextFocus.onLnkFocus();
                    this.currentFocus = nextFocus;
                }).defer(200,this);
Severity: Minor
Found in manager/assets/modext/util/superboxselect.js and 1 other location - About 30 mins to fix
manager/assets/modext/util/superboxselect.js on lines 834..839

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

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

        },{
            id: 'modx-user-blocked'
            ,name: 'blocked'
            ,hideLabel: true
            ,boxLabel: _('user_block')
Severity: Minor
Found in manager/assets/modext/widgets/security/modx.panel.user.js and 1 other location - About 30 mins to fix
manager/assets/modext/widgets/security/modx.panel.user.js on lines 263..271

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

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

                if (MODx.perm.usergroup_user_edit && ui.hasClass('padduser')) {
                    m.push({
                        text: _('user_group_user_add')
                        ,handler: this.addUser
                    });
Severity: Minor
Found in manager/assets/modext/widgets/security/modx.tree.user.group.js and 1 other location - About 30 mins to fix
manager/assets/modext/widgets/security/modx.grid.message.js on lines 220..226

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

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

                  top:        box.top + (window.pageYOffset || docEl.scrollTop)  - (docEl.clientTop || body.clientTop || 0)
Severity: Minor
Found in manager/assets/fileapi/FileAPI.js and 1 other location - About 30 mins to fix
manager/assets/fileapi/FileAPI.js on lines 4233..4233

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

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

                            if (r.object.client_version_result != 'success') {
                                cv.addClass('warning');
                            } else {
                                cv.addClass('success');
                            }
Severity: Minor
Found in setup/assets/js/sections/database.js and 1 other location - About 30 mins to fix
setup/assets/js/sections/database.js on lines 40..44

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

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

                , left:        box.left + (window.pageXOffset || docEl.scrollLeft) - (docEl.clientLeft || body.clientLeft || 0)
Severity: Minor
Found in manager/assets/fileapi/FileAPI.js and 1 other location - About 30 mins to fix
manager/assets/fileapi/FileAPI.js on lines 4232..4232

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

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

        if (r.data.read && MODx.user.id != r.data.sender) {
            m.push({
                text: _('mark_unread')
                ,handler: this.markUnread
            });
Severity: Minor
Found in manager/assets/modext/widgets/security/modx.grid.message.js and 1 other location - About 30 mins to fix
manager/assets/modext/widgets/security/modx.tree.user.group.js on lines 109..115

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

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

                if(nextFocus){
                    (function(){
                        nextFocus.onLnkFocus();
                        this.currentFocus = nextFocus;
                    }).defer(200,this);
Severity: Minor
Found in manager/assets/modext/util/superboxselect.js and 1 other location - About 30 mins to fix
manager/assets/modext/util/superboxselect.js on lines 761..766

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

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

        },{
            id: 'modx-user-active'
            ,name: 'active'
            ,hideLabel: true
            ,boxLabel: _('active')
Severity: Minor
Found in manager/assets/modext/widgets/security/modx.panel.user.js and 1 other location - About 30 mins to fix
manager/assets/modext/widgets/security/modx.panel.user.js on lines 271..279

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

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

    public function create_cache_parameter_group($cache_parameter_group_name, $cache_parameter_group_family, $description, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['CacheParameterGroupName'] = $cache_parameter_group_name;
        $opt['CacheParameterGroupFamily'] = $cache_parameter_group_family;
Severity: Major
Found in core/model/aws/services/elasticache.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function set_load_balancer_listener_ssl_certificate($load_balancer_name, $load_balancer_port, $ssl_certificate_id, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['LoadBalancerName'] = $load_balancer_name;
        $opt['LoadBalancerPort'] = $load_balancer_port;
Severity: Major
Found in core/model/aws/services/elb.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function delete_network_acl_entry($network_acl_id, $rule_number, $egress, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['NetworkAclId'] = $network_acl_id;
        $opt['RuleNumber'] = $rule_number;
Severity: Major
Found in core/model/aws/services/ec2.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function create_app_cookie_stickiness_policy($load_balancer_name, $policy_name, $cookie_name, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['LoadBalancerName'] = $load_balancer_name;
        $opt['PolicyName'] = $policy_name;
Severity: Major
Found in core/model/aws/services/elb.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function subscribe($topic_arn, $protocol, $endpoint, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['TopicArn'] = $topic_arn;
        $opt['Protocol'] = $protocol;
Severity: Major
Found in core/model/aws/services/sns.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function authorize_cache_security_group_ingress($cache_security_group_name, $ec2_security_group_name, $ec2_security_group_owner_id, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['CacheSecurityGroupName'] = $cache_security_group_name;
        $opt['EC2SecurityGroupName'] = $ec2_security_group_name;
Severity: Major
Found in core/model/aws/services/elasticache.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function put_group_policy($group_name, $policy_name, $policy_document, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['GroupName'] = $group_name;
        $opt['PolicyName'] = $policy_name;
Severity: Major
Found in core/model/aws/services/iam.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function set_alarm_state($alarm_name, $state_value, $state_reason, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['AlarmName'] = $alarm_name;
        $opt['StateValue'] = $state_value;
Severity: Major
Found in core/model/aws/services/cloudwatch.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function create_vpn_connection($type, $customer_gateway_id, $vpn_gateway_id, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['Type'] = $type;
        $opt['CustomerGatewayId'] = $customer_gateway_id;
Severity: Major
Found in core/model/aws/services/ec2.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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

    public function set_topic_attributes($topic_arn, $attribute_name, $attribute_value, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['TopicArn'] = $topic_arn;
        $opt['AttributeName'] = $attribute_name;
Severity: Major
Found in core/model/aws/services/sns.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/iam.class.php on lines 760..768
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 90.

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

    public function upload_server_certificate($server_certificate_name, $certificate_body, $private_key, $opt = null)
    {
        if (!$opt) $opt = array();
        $opt['ServerCertificateName'] = $server_certificate_name;
        $opt['CertificateBody'] = $certificate_body;
Severity: Major
Found in core/model/aws/services/iam.class.php and 16 other locations - About 30 mins to fix
core/model/aws/services/cloudwatch.class.php on lines 589..597
core/model/aws/services/ec2.class.php on lines 1077..1085
core/model/aws/services/ec2.class.php on lines 1928..1936
core/model/aws/services/ec2.class.php on lines 2028..2036
core/model/aws/services/ec2.class.php on lines 3382..3390
core/model/aws/services/elasticache.class.php on lines 206..214
core/model/aws/services/elasticache.class.php on lines 517..525
core/model/aws/services/elasticache.class.php on lines 567..575
core/model/aws/services/elb.class.php on lines 441..449
core/model/aws/services/elb.class.php on lines 502..510
core/model/aws/services/iam.class.php on lines 251..259
core/model/aws/services/iam.class.php on lines 542..550
core/model/aws/services/importexport.class.php on lines 95..103
core/model/aws/services/rds.class.php on lines 368..376
core/model/aws/services/sns.class.php on lines 208..216
core/model/aws/services/sns.class.php on lines 230..238

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

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