RackHD/on-dhcp-proxy

View on GitHub

Showing 60 of 60 total issues

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

    if(pkt.options && pkt.options.hostName) {               //option 12
        p.writeUInt8(12, i);
        i += 1; // option 12
        var hostName = new Buffer(pkt.options.hostName);
        p.writeUInt8(hostName.length, i);
Severity: Major
Found in lib/packet.js and 4 other locations - About 3 hrs to fix
lib/packet.js on lines 282..290
lib/packet.js on lines 414..422
lib/packet.js on lines 448..456
lib/packet.js on lines 457..465

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

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

Function prepareGrunt has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function prepareGrunt(grunt) {
    var allFiles = [
        'package.json',
        'Gruntfile.js',
        'lib/**/*.js',
Severity: Major
Found in gruntfile.js - About 3 hrs to fix

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

        if (pkt.options && pkt.options.subnetAddress) {          // option 118
            p.writeUInt8(118, i);
            i += 1; // option 118
            var subnetAddress = new Buffer(
                new v4.Address(pkt.options.subnetAddress).toArray());
    Severity: Major
    Found in lib/packet.js and 1 other location - About 3 hrs to fix
    lib/packet.js on lines 368..377

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

    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 (pkt.options && pkt.options.serverIdentifier) {      // option 54
            p.writeUInt8(54, i);
            i += 1; // option 54
            var serverIdentifier = new Buffer(
                new v4.Address(pkt.options.serverIdentifier).toArray());
    Severity: Major
    Found in lib/packet.js and 1 other location - About 3 hrs to fix
    lib/packet.js on lines 485..494

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

    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

    Function messageHandlerFactory has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    function messageHandlerFactory(
        packetUtil,
        parser,
        lookupService,
        configuration,
    Severity: Minor
    Found in lib/message-handler.js - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

        if (pkt.options && pkt.options.archType) {                  // option 93
            p.writeUInt8(93, i);
            i += 1; // option 57
            p.writeUInt8(2, i);
            i += 1; // length
    Severity: Major
    Found in lib/packet.js and 6 other locations - About 3 hrs to fix
    lib/packet.js on lines 206..213
    lib/packet.js on lines 338..345
    lib/packet.js on lines 346..353
    lib/packet.js on lines 390..397
    lib/packet.js on lines 398..405
    lib/packet.js on lines 406..413

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

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

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

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

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

    Refactorings

    Further Reading

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

        if (pkt.options && pkt.options.timeOffset) {            // option 2
            p.writeUInt8(2, i);
            i += 1; // option 2
            p.writeUInt8(4, i);
            i += 1; // length
    Severity: Major
    Found in lib/packet.js and 6 other locations - About 3 hrs to fix
    lib/packet.js on lines 338..345
    lib/packet.js on lines 346..353
    lib/packet.js on lines 390..397
    lib/packet.js on lines 398..405
    lib/packet.js on lines 406..413
    lib/packet.js on lines 477..484

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

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

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

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

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

    Refactorings

    Further Reading

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

        if (pkt.options && pkt.options.maximumMessageSize) {      // option 57
            p.writeUInt8(57, i);
            i += 1; // option 57
            p.writeUInt8(2, i);
            i += 1; // length
    Severity: Major
    Found in lib/packet.js and 6 other locations - About 3 hrs to fix
    lib/packet.js on lines 206..213
    lib/packet.js on lines 338..345
    lib/packet.js on lines 346..353
    lib/packet.js on lines 398..405
    lib/packet.js on lines 406..413
    lib/packet.js on lines 477..484

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

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

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

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

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

    Refactorings

    Further Reading

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

        if (pkt.options && pkt.options.renewalTimeValue) {      // option 58
            p.writeUInt8(58, i);
            i += 1; // option 58
            p.writeUInt8(4, i);
            i += 1; // length
    Severity: Major
    Found in lib/packet.js and 6 other locations - About 3 hrs to fix
    lib/packet.js on lines 206..213
    lib/packet.js on lines 338..345
    lib/packet.js on lines 346..353
    lib/packet.js on lines 390..397
    lib/packet.js on lines 406..413
    lib/packet.js on lines 477..484

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

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

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

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

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

    Refactorings

    Further Reading

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

        if (pkt.options && pkt.options.optionOverload) {        // option 52
            p.writeUInt8(52, i);
            i += 1; // option 52
            p.writeUInt8(1, i);
            i += 1; // length
    Severity: Major
    Found in lib/packet.js and 6 other locations - About 3 hrs to fix
    lib/packet.js on lines 206..213
    lib/packet.js on lines 338..345
    lib/packet.js on lines 390..397
    lib/packet.js on lines 398..405
    lib/packet.js on lines 406..413
    lib/packet.js on lines 477..484

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

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

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

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

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

    Refactorings

    Further Reading

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

        if (pkt.options && pkt.options.rebindingTimeValue) {    // option 59
            p.writeUInt8(59, i);
            i += 1; // option 59
            p.writeUInt8(4, i);
            i += 1; // length
    Severity: Major
    Found in lib/packet.js and 6 other locations - About 3 hrs to fix
    lib/packet.js on lines 206..213
    lib/packet.js on lines 338..345
    lib/packet.js on lines 346..353
    lib/packet.js on lines 390..397
    lib/packet.js on lines 398..405
    lib/packet.js on lines 477..484

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

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

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

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

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

    Refactorings

    Further Reading

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

        if (pkt.options && pkt.options.ipAddressLeaseTime) {    // option 51
            p.writeUInt8(51, i);
            i += 1; // option 51
            p.writeUInt8(4, i);
            i += 1; // length
    Severity: Major
    Found in lib/packet.js and 6 other locations - About 3 hrs to fix
    lib/packet.js on lines 206..213
    lib/packet.js on lines 346..353
    lib/packet.js on lines 390..397
    lib/packet.js on lines 398..405
    lib/packet.js on lines 406..413
    lib/packet.js on lines 477..484

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

    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

    Function ProtocolFactory has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ProtocolFactory() {
        var createEnum = function (v, n) {
            function Enum(value, name) {
                this.value = value;
                this.name = name;
    Severity: Major
    Found in lib/dhcp-protocol.js - About 3 hrs to fix

      File parser.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       Copyright (c) 2011-2014 Andrew Paprocki
      
       Permission is hereby granted, free of charge, to any person obtaining a copy
       of this software and associated documentation files (the "Software"), to deal
      Severity: Minor
      Found in lib/parser.js - About 3 hrs to fix

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

                            case 59: {          // rebindingTimeValue
                                this.len = msg.readUInt8(offset);
                                offset += 1;
                                assert.strictEqual(this.len, 4);
                                this.packet.options.rebindingTimeValue = msg.readUInt32BE(offset);
        Severity: Major
        Found in lib/parser.js and 4 other locations - About 2 hrs to fix
        lib/parser.js on lines 131..138
        lib/parser.js on lines 252..259
        lib/parser.js on lines 260..267
        lib/parser.js on lines 308..315

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

                            case 57: {          // maximumMessageSize
                                this.len = msg.readUInt8(offset);
                                offset += 1;
                                assert.strictEqual(this.len, 2);
                                this.packet.options.maximumMessageSize = msg.readUInt16BE(offset);
        Severity: Major
        Found in lib/parser.js and 4 other locations - About 2 hrs to fix
        lib/parser.js on lines 131..138
        lib/parser.js on lines 260..267
        lib/parser.js on lines 268..275
        lib/parser.js on lines 308..315

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

                            case 2: {           // timeOffset
                                this.len = msg.readUInt8(offset);
                                offset += 1;
                                assert.strictEqual(this.len, 4);
                                this.packet.options.timeOffset = msg.readUInt32BE(offset);
        Severity: Major
        Found in lib/parser.js and 4 other locations - About 2 hrs to fix
        lib/parser.js on lines 252..259
        lib/parser.js on lines 260..267
        lib/parser.js on lines 268..275
        lib/parser.js on lines 308..315

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

                            case 93: {          // system architecture
                                this.len = msg.readUInt8(offset);
                                offset += 1;
                                assert.strictEqual(this.len, 2);
                                this.packet.options.archType = msg.readUInt16BE(offset);
        Severity: Major
        Found in lib/parser.js and 4 other locations - About 2 hrs to fix
        lib/parser.js on lines 131..138
        lib/parser.js on lines 252..259
        lib/parser.js on lines 260..267
        lib/parser.js on lines 268..275

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

                            case 58: {          // renewalTimeValue
                                this.len = msg.readUInt8(offset);
                                offset += 1;
                                assert.strictEqual(this.len, 4);
                                this.packet.options.renewalTimeValue = msg.readUInt32BE(offset);
        Severity: Major
        Found in lib/parser.js and 4 other locations - About 2 hrs to fix
        lib/parser.js on lines 131..138
        lib/parser.js on lines 252..259
        lib/parser.js on lines 268..275
        lib/parser.js on lines 308..315

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

                            case 51: {          // ipAddressLeaseTime
                                this.len = msg.readUInt8(offset);
                                offset += 1;
                                assert.strictEqual(this.len, 4);
                                this.packet.options.ipAddressLeaseTime =
        Severity: Major
        Found in lib/parser.js and 1 other location - About 2 hrs to fix
        lib/parser.js on lines 218..225

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

        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