Method runScript
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void runScript( Map<String,String> parameters, String script )
throws IOException {
try (LineNumberReader lnr = new LineNumberReader(new StringReader(script))) {
String nextLine;
Method runScript
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public void runScript( Map<String,String> parameters, String script )
throws IOException {
try (LineNumberReader lnr = new LineNumberReader(new StringReader(script))) {
String nextLine;
- 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 substituteParameters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static String substituteParameters( final Map<String,String> values,
final String text ) {
String textToModify = text;
while( true ) {
- 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 removeEscapeCharacters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static String removeEscapeCharacters( String original ) {
StringBuilder newString = new StringBuilder(original.length());
for( int i = 0 ; i < original.length() ; i++) {
char thisChar = original.charAt(i);
if(thisChar == '\\') {
- 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 waitForString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void waitForString( String theString )
throws IOException {
InputWaiter waiter;
if ( theString.startsWith("stdout") ) {
waiter = new InputWaiter(stdout, theString.substring(7, theString.length()), WAIT_TIMEOUT);
- 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"