rapid7/metasploit-framework

View on GitHub

Showing 6,027 of 21,757 total issues

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/principal_name.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

    def decode(input)
      case input
      when String
        decode_string(input)
      when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/transited_encoding.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/pre_auth_for_user.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/last_request.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/encrypted_data.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/enc_ap_rep_part.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/ticket.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/krb_cred_info.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/checksum.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

  def decode(input)
    case input
    when String
      decode_string(input)
    when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/host_address.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

class String
  def red
    "\e[1;31;40m#{self}\e[0m"
  end

Severity: Minor
Found in tools/dev/msftidy_docs.rb and 3 other locations - About 15 mins to fix
tools/dev/check_external_scripts.rb on lines 30..44
tools/dev/msftidy.rb on lines 26..40
tools/dev/update_wordpress_vulnerabilities.rb on lines 25..39

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

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

class String
  def red
    "\e[1;31;40m#{self}\e[0m"
  end

Severity: Minor
Found in tools/dev/msftidy.rb and 3 other locations - About 15 mins to fix
tools/dev/check_external_scripts.rb on lines 30..44
tools/dev/msftidy_docs.rb on lines 17..31
tools/dev/update_wordpress_vulnerabilities.rb on lines 25..39

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

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 (datastore['SRVHOST'] == "0.0.0.0" or datastore['SRVHOST'] == "::")
      srv_host = datastore['URIHOST'] || Rex::Socket.source_address(rhost)
    else
      srv_host = datastore['SRVHOST']
    end
modules/exploits/linux/smtp/exim4_dovecot_exec.rb on lines 123..127
modules/exploits/multi/http/bassmaster_js_injection.rb on lines 138..142
modules/exploits/multi/http/rails_dynamic_render_code_exec.rb on lines 159..163

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

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 (datastore['SRVHOST'] == "0.0.0.0" or datastore['SRVHOST'] == "::")
        srv_host = datastore['URIHOST'] || Rex::Socket.source_address(rhost)
      else
        srv_host = datastore['SRVHOST']
      end
Severity: Minor
Found in modules/exploits/linux/smtp/exim4_dovecot_exec.rb and 3 other locations - About 15 mins to fix
modules/exploits/multi/http/bassmaster_js_injection.rb on lines 138..142
modules/exploits/multi/http/rails_dynamic_render_code_exec.rb on lines 159..163
modules/exploits/multi/http/trendmicro_threat_discovery_admin_sys_time_cmdi.rb on lines 160..164

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

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

class String
  def red
    "\e[1;31;40m#{self}\e[0m"
  end

Severity: Minor
Found in tools/dev/check_external_scripts.rb and 3 other locations - About 15 mins to fix
tools/dev/msftidy.rb on lines 26..40
tools/dev/msftidy_docs.rb on lines 17..31
tools/dev/update_wordpress_vulnerabilities.rb on lines 25..39

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

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 (datastore['SRVHOST'] == "0.0.0.0" or datastore['SRVHOST'] == "::")
      srv_host = datastore['URIHOST'] || Rex::Socket.source_address(rhost)
    else
      srv_host = datastore['SRVHOST']
    end
Severity: Minor
Found in modules/exploits/multi/http/bassmaster_js_injection.rb and 3 other locations - About 15 mins to fix
modules/exploits/linux/smtp/exim4_dovecot_exec.rb on lines 123..127
modules/exploits/multi/http/rails_dynamic_render_code_exec.rb on lines 159..163
modules/exploits/multi/http/trendmicro_threat_discovery_admin_sys_time_cmdi.rb on lines 160..164

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

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 (datastore['SRVHOST'] == "0.0.0.0" or datastore['SRVHOST'] == "::")
      srv_host = datastore['URIHOST'] || Rex::Socket.source_address(rhost)
    else
      srv_host = datastore['SRVHOST']
    end
Severity: Minor
Found in modules/exploits/multi/http/rails_dynamic_render_code_exec.rb and 3 other locations - About 15 mins to fix
modules/exploits/linux/smtp/exim4_dovecot_exec.rb on lines 123..127
modules/exploits/multi/http/bassmaster_js_injection.rb on lines 138..142
modules/exploits/multi/http/trendmicro_threat_discovery_admin_sys_time_cmdi.rb on lines 160..164

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

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

class String
  def red
    "\e[1;31;40m#{self}\e[0m"
  end

Severity: Minor
Found in tools/dev/update_wordpress_vulnerabilities.rb and 3 other locations - About 15 mins to fix
tools/dev/check_external_scripts.rb on lines 30..44
tools/dev/msftidy.rb on lines 26..40
tools/dev/msftidy_docs.rb on lines 17..31

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

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

  def generate_bind_tcp_rc4(opts={})
    combined_asm = %Q^
      cld                    ; Clear the direction flag.
      call start             ; Call start, this pushes the address of 'api_call' onto the stack.
      #{asm_block_api}
Severity: Major
Found in lib/msf/core/payload/windows/bind_tcp_rc4.rb and 10 other locations - About 15 mins to fix
lib/msf/core/payload/windows/bind_tcp.rb on lines 61..71
lib/msf/core/payload/windows/reverse_tcp.rb on lines 64..74
lib/msf/core/payload/windows/reverse_tcp_dns.rb on lines 48..58
lib/msf/core/payload/windows/reverse_tcp_rc4.rb on lines 43..53
lib/msf/core/payload/windows/reverse_tcp_rc4_dns.rb on lines 43..53
lib/msf/core/payload/windows/reverse_udp.rb on lines 43..53
lib/msf/core/payload/windows/x64/bind_tcp_rc4_x64.rb on lines 48..59
lib/msf/core/payload/windows/x64/bind_tcp_x64.rb on lines 56..67
lib/msf/core/payload/windows/x64/reverse_tcp_rc4_x64.rb on lines 50..61
lib/msf/core/payload/windows/x64/reverse_tcp_x64.rb on lines 57..68

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

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