Showing 32 of 651 total issues
Method elasticsearchTemplate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Bean
public ElasticsearchOperations elasticsearchTemplate() {
String clusterName = environment
.getProperty("elasticsearch.cluster.name");
String nodeName = environment.getProperty("elasticsearch.node.name");
- Create a ticketCreate a ticket
Function success
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
success:function (data) {
var jsonData = JSON.parse(data);
var status = jsonData.status;
if(status === "success") {
$.ajax({
- Create a ticketCreate a ticket
Function login
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
login : function(event) {
event.preventDefault();
var formValues = {
email: $('#inputEmail').val(),
password: $('#inputPassword').val()
- Create a ticketCreate a ticket
Method calculateMetrics
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void calculateMetrics() {
log.info("==========================================");
log.info("Session Name : " + sessionName);
log.info("Pcap Path: " + pcapPath);
- Create a ticketCreate a ticket
Function loginCheck
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loginCheck(callback) {
$.ajax({
url:'/protocolanalyzer/auth',
type:'GET',
contentType: 'application/json; charset=utf-8',
- Create a ticketCreate a ticket
Method run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void run() {
this.isRunning = true;
while (!buckets.isEmpty()) {
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
for(var prop=0;prop<values.length;prop++){
for(var i=0;i < _this._layers.length-1;i++){
if(_this._layers[i]===values[prop]){
matchOneLayerToNext++;
}
- Create a ticketCreate a ticket
Method bitToByte
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static byte bitToByte(byte[] original, int lower, int higher,
int extraBits, boolean reverse) {
- Create a ticketCreate a ticket
Method configureSessionCells
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void configureSessionCells(Session session) {
if (protocolGraph == null) {
log.info("protocolgraph is null in Protocolgraph!!");
} else {
for (Entry<String, Set<String>> entry : protocolGraph.entrySet()) {
- Read upRead up
- Create a ticketCreate a ticket
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
Function multiGet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
multiGet : function(startId,endId,layerCount){
startId = Number(startId);
endId = Number(endId);
layerCount = Number(layerCount);
if(endId > sessionStorage.getItem('packetCount')){
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid too many return
statements within this method. Open
return "INVALID-ADDRESS";
- Create a ticketCreate a ticket
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void run() {
while (isRunning) {
if (!isProcessing) {
if (!inputQueue.isEmpty()) {
- Read upRead up
- Create a ticketCreate a ticket
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"