rapid7/metasploit-framework

View on GitHub
lib/rex/proto/smb/constants.rb

Summary

Maintainability
F
6 days
Test Coverage

File constants.rb has 1171 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Rex
module Proto
module SMB
class Constants

Severity: Major
Found in lib/rex/proto/smb/constants.rb - About 3 days to fix

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

      SMB_TRANS2_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v',  'ParamCountTotal',     0 ],
        [ 'uint16v',  'DataCountTotal',      0 ],
        [ 'uint16v',  'ParamCountMax',       0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 2 hrs to fix
    lib/rex/proto/smb/constants.rb on lines 800..821

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

    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

      SMB_TRANS_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v',  'ParamCountTotal',     0 ],
        [ 'uint16v',  'DataCountTotal',      0 ],
        [ 'uint16v',  'ParamCountMax',       0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 2 hrs to fix
    lib/rex/proto/smb/constants.rb on lines 851..872

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

    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

      SMB_TRANS_RES_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v',  'ParamCountTotal',     0 ],
        [ 'uint16v',  'DataCountTotal',      0 ],
        [ 'uint16v',  'Reserved1',           0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 923..940

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

    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

      SMB_NTTRANS_SECONDARY_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',    'Reserved1',           0 ],
        [ 'uint16v',  'Reserved2',           0 ],
        [ 'uint32v',  'ParamCountTotal',     0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 827..844

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

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

      SMB_NEG_RES_LM_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v', 'Dialect',              0 ],
        [ 'uint16v', 'SecurityMode',         0 ],
        [ 'uint16v', 'MaxBuff',              0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 3 other locations - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 620..637
    lib/rex/proto/smb/constants.rb on lines 1040..1057
    lib/rex/proto/smb/constants.rb on lines 1081..1098

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

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

      SMB_OPEN_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',    'AndX',                0 ],
        [ 'uint8',    'Reserved1',           0 ],
        [ 'uint16v',  'AndXOffset',          0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 3 other locations - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 597..614
    lib/rex/proto/smb/constants.rb on lines 620..637
    lib/rex/proto/smb/constants.rb on lines 1040..1057

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

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

      SMB_NEG_RES_NT_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v', 'Dialect',              0 ],
        [ 'uint8',   'SecurityMode',         0 ],
        [ 'uint16v', 'MaxMPX',               0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 3 other locations - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 597..614
    lib/rex/proto/smb/constants.rb on lines 1040..1057
    lib/rex/proto/smb/constants.rb on lines 1081..1098

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

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

      SMB_WRITE_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',    'AndX',                0 ],
        [ 'uint8',    'Reserved1',           0 ],
        [ 'uint16v',  'AndXOffset',          0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 3 other locations - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 597..614
    lib/rex/proto/smb/constants.rb on lines 620..637
    lib/rex/proto/smb/constants.rb on lines 1081..1098

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

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

      SMB_SETUP_NTLMV1_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',   'AndX',                 0 ],
        [ 'uint8',   'Reserved1',            0 ],
        [ 'uint16v', 'AndXOffset',           0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 2 other locations - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 902..918
    lib/rex/proto/smb/constants.rb on lines 1198..1214

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

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

      SMB_NTTRANS_RES_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',    'Reserved1',           0 ],
        [ 'uint16v',  'Reserved2',           0 ],
        [ 'uint32v',  'ParamCountTotal',     0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 2 other locations - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 687..703
    lib/rex/proto/smb/constants.rb on lines 1198..1214

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

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

      SMB_READ_RES_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',    'AndX',                0 ],
        [ 'uint8',    'Reserved1',           0 ],
        [ 'uint16v',  'AndXOffset',          0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 2 other locations - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 687..703
    lib/rex/proto/smb/constants.rb on lines 902..918

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

    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

      SMB_READ_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',    'AndX',                0 ],
        [ 'uint8',    'Reserved1',           0 ],
        [ 'uint16v',  'AndXOffset',          0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 709..724

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

    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

      SMB_SETUP_NTLMV2_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',   'AndX',                 0 ],
        [ 'uint8',   'Reserved1',            0 ],
        [ 'uint16v', 'AndXOffset',           0 ],
    Severity: Major
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 1 hr to fix
    lib/rex/proto/smb/constants.rb on lines 1177..1192

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

    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

      SMB_SETUP_NTLMV2_RES_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',   'AndX',                 0 ],
        [ 'uint8',   'Reserved1',            0 ],
        [ 'uint16v', 'AndXOffset',           0 ],
    Severity: Minor
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 55 mins to fix
    lib/rex/proto/smb/constants.rb on lines 746..756

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 44.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      SMB_TREE_CONN_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint8',   'AndX',                 0 ],
        [ 'uint8',   'Reserved1',            0 ],
        [ 'uint16v', 'AndXOffset',           0 ],
    Severity: Minor
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 55 mins to fix
    lib/rex/proto/smb/constants.rb on lines 730..740

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 44.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      SMB_DELETE_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v',  'SearchAttribute',     0 ],
        [ 'uint16v',  'ByteCount',           0 ],
        [ 'uint8',    'BufferFormat',        0 ],
    Severity: Minor
    Found in lib/rex/proto/smb/constants.rb and 2 other locations - About 30 mins to fix
    lib/rex/proto/smb/constants.rb on lines 1128..1135
    lib/rex/proto/smb/constants.rb on lines 1221..1228

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

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

      SMB_SEARCH_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v',  'MaxCount',            0 ],
        [ 'uint16v',  'Attributes',          0 ],
        [ 'uint16v',  'ByteCount',           0 ],
    Severity: Minor
    Found in lib/rex/proto/smb/constants.rb and 2 other locations - About 30 mins to fix
    lib/rex/proto/smb/constants.rb on lines 1128..1135
    lib/rex/proto/smb/constants.rb on lines 1152..1159

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

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

      SMB_CLOSE_HDR_PKT = Rex::Struct2::CStructTemplate.new(
        [ 'template', 'SMB',                 SMB_HDR ],
        [ 'uint16v',  'FileID',              0 ],
        [ 'uint32v',  'LastWrite',           0 ],
        [ 'uint16v',  'ByteCount',           0 ],
    Severity: Minor
    Found in lib/rex/proto/smb/constants.rb and 2 other locations - About 30 mins to fix
    lib/rex/proto/smb/constants.rb on lines 1152..1159
    lib/rex/proto/smb/constants.rb on lines 1221..1228

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

    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

      SMB_QUERY_FILE_STANDARD_INFO_HDR = Rex::Struct2::CStructTemplate.new(
        ['uint64v', 'AllocationSize', 0],
        ['uint64v', 'EndOfFile',      0],
        ['uint32v', 'NumberOfLinks',  0],
        ['uint8',   'DeletePending',  0],
    Severity: Minor
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 15 mins to fix
    lib/rex/proto/smb/constants.rb on lines 1233..1238

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

      SMB_TRANS2_FIND_FIRST2_RES_PARAMETERS = Rex::Struct2::CStructTemplate.new(
        ['uint16v', 'SID',            0],
        ['uint16v', 'SearchCount',    0],
        ['uint16v', 'EndOfSearch',    0],
        ['uint16v', 'EaErrorOffset',  0],
    Severity: Minor
    Found in lib/rex/proto/smb/constants.rb and 1 other location - About 15 mins to fix
    lib/rex/proto/smb/constants.rb on lines 1344..1349

    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

    There are no issues that match your filters.

    Category
    Status