prasadtalasila/BITS-Darshini

View on GitHub

Showing 77 of 651 total issues

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  public void configure(EventBus eventBus, AnalysisRepository repository, String sessionName) {
    this.eventBus = eventBus;
    this.eventBus.register(this);
    this.repository = repository;
    this.indexName = "protocol_" + sessionName;
src/main/java/in/ac/bits/protocolanalyzer/analyzer/link/EthernetAnalyzer.java on lines 36..41
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 38..43
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 37..42
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 37..42
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 37..42

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

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

  public void configure(EventBus eventBus, AnalysisRepository repository, String sessionName) {
    this.eventBus = eventBus;
    this.eventBus.register(this);
    this.repository = repository;
    this.indexName = "protocol_" + sessionName;
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 40..45
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 38..43
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 37..42
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 37..42
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 37..42

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

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

  public void configure(EventBus eventBus, AnalysisRepository repository, String sessionName) {
    this.eventBus = eventBus;
    this.eventBus.register(this);
    this.repository = repository;
    this.indexName = "protocol_" + sessionName;
src/main/java/in/ac/bits/protocolanalyzer/analyzer/link/EthernetAnalyzer.java on lines 36..41
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 40..45
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 38..43
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 37..42
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 37..42

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

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

            $(document).ready(function() {
              document.getElementById("username").innerHTML = Cookies.get('userName');
            });
Severity: Minor
Found in src/main/webapp/WEB-INF/js/views/experiment-view.js and 1 other location - About 35 mins to fix
src/main/webapp/WEB-INF/js/views/dashboard-view.js on lines 25..27

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

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

        $(document).ready(function() {
          document.getElementById("username").innerHTML = Cookies.get('userName');
        });
Severity: Minor
Found in src/main/webapp/WEB-INF/js/views/dashboard-view.js and 1 other location - About 35 mins to fix
src/main/webapp/WEB-INF/js/views/experiment-view.js on lines 108..110

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

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

package in.ac.bits.protocolanalyzer.persistence.entity;

import java.lang.String;
import lombok.Getter;
import lombok.Setter;
src/main/java/in/ac/bits/protocolanalyzer/persistence/entity/EthernetEntity.java on lines 1..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 43.

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

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

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

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

Refactorings

Further Reading

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

package in.ac.bits.protocolanalyzer.persistence.entity;

import java.lang.String;
import lombok.Getter;
import lombok.Setter;
src/main/java/in/ac/bits/protocolanalyzer/persistence/entity/IcmpEntity.java on lines 1..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 43.

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

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

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

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

Refactorings

Further Reading

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

        String addressString = address[0] + "." + address[1] + "." + address[2]
                + "." + address[3];
src/main/java/in/ac/bits/protocolanalyzer/utils/Beautify.java on lines 20..21

Duplicated Code

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

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

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

Tuning

This issue has a mass of 43.

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

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

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

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

Refactorings

Further Reading

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

                return address[0] + "." + address[1] + "." + address[2] + "."
                        + address[3];
Severity: Minor
Found in src/main/java/in/ac/bits/protocolanalyzer/utils/Beautify.java and 1 other location - About 35 mins to fix
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Address.java on lines 20..21

Duplicated Code

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

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

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

Tuning

This issue has a mass of 43.

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

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

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

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

Refactorings

Further Reading

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

            for (int i = 0; i < fullBytes.length; i++) {
                returnBytes[i + 1] = fullBytes[i];
            }
src/main/java/in/ac/bits/protocolanalyzer/utils/BitOperator.java on lines 132..134

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

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

            for (int i = 0; i < fullBytes.length; i++) {
                returnBytes[i + 1] = fullBytes[i];
            }
src/main/java/in/ac/bits/protocolanalyzer/utils/BitOperator.java on lines 145..147

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

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

  public short getType_(byte[] icmpHeader) {
    byte[] type_ = BitOperator.parse(icmpHeader, IcmpHeader.TYPE__START_BIT, IcmpHeader.TYPE__END_BIT);
    short returnVar = ByteOperator.parseBytesshort(type_);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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

  public int getLength_(byte[] udpHeader) {
    byte[] length_ = BitOperator.parse(udpHeader, UdpHeader.LENGTH__START_BIT, UdpHeader.LENGTH__END_BIT);
    int returnVar = ByteOperator.parseBytesint(length_);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73

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

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

  public int getIdentification(byte[] ipv4Header) {
    byte[] identification = BitOperator.parse(ipv4Header, IPv4Header.IDENTIFICATION_START_BIT, IPv4Header.IDENTIFICATION_END_BIT);
    int returnVar = ByteOperator.parseBytesint(identification);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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

  public short getFragOffset(byte[] ipv4Header) {
    byte[] fragoffset = BitOperator.parse(ipv4Header, IPv4Header.FRAGOFFSET_START_BIT, IPv4Header.FRAGOFFSET_END_BIT);
    short returnVar = ByteOperator.parseBytesshort(fragoffset);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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

  public byte getDataOffset(byte[] tcpHeader) {
    byte[] dataoffset = BitOperator.parse(tcpHeader, TcpHeader.DATAOFFSET_START_BIT, TcpHeader.DATAOFFSET_END_BIT);
    byte returnVar = ByteOperator.parseBytesbyte(dataoffset);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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

  public byte getVersion(byte[] ipv6Header) {
    byte[] version = BitOperator.parse(ipv6Header, IPv6Header.VERSION_START_BIT, IPv6Header.VERSION_END_BIT);
    byte returnVar = ByteOperator.parseBytesbyte(version);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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

  public byte getVersion(byte[] ipv4Header) {
    byte[] version = BitOperator.parse(ipv4Header, IPv4Header.VERSION_START_BIT, IPv4Header.VERSION_END_BIT);
    byte returnVar = ByteOperator.parseBytesbyte(version);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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

  public long getAckNo(byte[] tcpHeader) {
    byte[] ackno = BitOperator.parse(tcpHeader, TcpHeader.ACKNO_START_BIT, TcpHeader.ACKNO_END_BIT);
    long returnVar = ByteOperator.parseByteslong(ackno);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 76..80
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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

  public int getFlowLabel(byte[] ipv6Header) {
    byte[] flowlabel = BitOperator.parse(ipv6Header, IPv6Header.FLOWLABEL_START_BIT, IPv6Header.FLOWLABEL_END_BIT);
    int returnVar = ByteOperator.parseBytesint(flowlabel);
    return returnVar;
  }
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 66..70
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 72..76
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 78..82
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 89..93
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 95..99
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 101..105
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv4Analyzer.java on lines 107..111
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 64..68
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 70..74
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 82..86
src/main/java/in/ac/bits/protocolanalyzer/analyzer/network/IPv6Analyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/IcmpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 75..79
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 81..85
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 87..91
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 93..97
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 99..103
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 105..109
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/TcpAnalyzer.java on lines 116..120
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 63..67
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 69..73
src/main/java/in/ac/bits/protocolanalyzer/analyzer/transport/UdpAnalyzer.java on lines 75..79

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

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