Method nextClean
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public char nextClean() throws JSONException {
for (;;) {
char c = next();
if (c == '/') {
switch (next()) {
- Read upRead up
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
Method nextValue
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
- Read upRead up
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
Method nextValue
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
File JSONTokener.java
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
//#preprocess
/* *************************************************
* Copyright (c) 2010 - 2012
* HT srl, All rights reserved.
Method nextString
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public String nextString(char quote) throws JSONException {
char c;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
Method nextClean
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public char nextClean() throws JSONException {
for (;;) {
char c = next();
if (c == '/') {
switch (next()) {
Method nextString
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public String nextString(char quote) throws JSONException {
char c;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
- Read upRead up
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
if (c == 0) {
throw syntaxError(Messages.getString("2.3")); //$NON-NLS-1$
}
Avoid deeply nested control flow statements. Open
if (c == '*') {
if (next() == '/') {
break;
}
back();
Method nextTo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public String nextTo(char d) {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (c == d || c == 0 || c == '\n' || c == '\r') {
- Read upRead up
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
Method nextTo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public String nextTo(String delimiters) {
char c;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
- Read upRead up
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 new Integer(Integer.parseInt(s, 8));
Avoid too many return
statements within this method. Open
return JSONObject.NULL;
Avoid too many return
statements within this method. Open
return s;
Avoid too many return
statements within this method. Open
return Double.valueOf(s);
Avoid too many return
statements within this method. Open
return new Integer(Integer.parseInt(s.substring(2), 16));
Avoid too many return
statements within this method. Open
return new Long(Long.parseLong(s));
Avoid too many return
statements within this method. Open
return s;
Avoid too many return
statements within this method. Open
return Integer.valueOf(s);
Method dehexchar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
- Read upRead up
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"