Showing 3,994 of 4,023 total issues
Method processNode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private StringBuilder processNode(JsonNode node, StringBuilder resultBuilder, String delimiter, StringBuilder currentPath) {
StringBuilder copy = new StringBuilder(currentPath);
if (node.has(ENTITY_PROPERTIES)) {
currentPath.append(node.path(ENTITY_PROPERTIES).get(NAME).asText()).append(DEFAULT_DELIMITER);
}
- 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 verifyAuthorizationInputs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyAuthorizationInputs(@Nullable final String loginType, @Nullable final String clientId, @Nullable final String clientSecret, @Nullable final String username, @Nullable final String password, @NotNull final String proxyPort) {
Method getHttpClientInputs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static HttpClientInputs getHttpClientInputs(String username, String password, String proxyHost, String proxyPort,
String proxyUsername, String proxyPassword, String trustAllRoots,
String x509HostnameVerifier, String trustKeystore, String trustPassword,
String keystore, String keystorePassword, String connectTimeout,
String socketTimeout, String useCookies, String keepAlive, String method) {
- 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 parseDate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static Date parseDate(String toParse, int style) throws ParseException {
Date d;
try {
DateFormat f = DateFormat.getDateTimeInstance(style, DateFormat.MEDIUM);
d = f.parse(toParse);
- 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 getOrDefaultDBClassMSSQLQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@NotNull
public static String getOrDefaultDBClassMSSQLQuery(final String dbClass, final String dbType, final String authType) {
if (isNoneEmpty(dbClass)) {
return dbClass;
}
- 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 (removedList == null) {
removedList = new ArrayList<>();
removedList.add(dsKey);
removedDsKeyTable.put(dbPoolKey, removedList);
} else {
Avoid deeply nested control flow statements. Open
if (colCount >= 4) {
sqlInputs.getLRows().add(rs.getString(4));
}
Method loadJdbcDriver
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void loadJdbcDriver(String dbClass, final String authenticationType, final String sqlJdbcAuthFilePath) throws ClassNotFoundException {
boolean driverFound = false;
initializeJdbcDrivers();
for (String driver : supportedJdbcDrivers) {
if (driver.equals(dbClass)) {
- 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 getPooledConnection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private Connection getPooledConnection(PooledDataSource ds, String aUsername, String aPassword) throws SQLException {
Connection retCon;
try {
retCon = ds.getConnection();
} catch (Exception e) {
- 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 getConnection
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public synchronized Connection getConnection(DBType aDbType, String aAuthType, String aDbUrl, String aUsername, String aPassword, Properties properties)
Avoid deeply nested control flow statements. Open
if (removedDsKeyTable == null) {
removedDsKeyTable = new Hashtable<>();
} else {
removedList = removedDsKeyTable.get(dbPoolKey);
}
Method addVerifySchedulerTime
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@NotNull
private static List<String> addVerifySchedulerTime(@NotNull List<String> exceptions, @NotNull final String input) {
String[] timeFormat = input.split(COLON);
if (timeFormat.length != 3) {
exceptions.add(String.format(EXCEPTION_SCHEDULER_TIME, Constants.SchedulerTimeConstants.SCHEDULER_TIME));
- 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 (sqlInputs.getLRowsFiles().size() == nr) {
sqlInputs.getLRowsFiles().add(nr, new ArrayList<String>());
sqlInputs.getLRowsNames().add(nr, new ArrayList<String>());
}
Method getValidKeyOrValueTag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static String getValidKeyOrValueTag(String input, String pattern, boolean isKey, boolean condition,
boolean patternCheck, int keyMaxLength, int valueMaxLength) {
if (isKey && (condition || input.length() > keyMaxLength)) {
throw new RuntimeException(getValidationException(input, false));
} else if (!isKey && input.length() > valueMaxLength) {
- 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 getValidStringArray
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private static String[] getValidStringArray(String[] referenceArray, String inputString, String condition,
String delimiter, String firstInputName, String secondInputName) {
Method addVerifySchedulerTime
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@NotNull
private static List<String> addVerifySchedulerTime(@NotNull List<String> exceptions, @NotNull final String input) {
String[] timeFormat = input.split(COLON);
if (timeFormat.length != 3) {
exceptions.add(String.format(EXCEPTION_SCHEDULER_TIME, Constants.SchedulerTimeConstants.SCHEDULER_TIME));
- 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 verifyGetCellInputs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static List<String> verifyGetCellInputs(@NotNull final String excelFileName,
@NotNull final String hasHeader,
@NotNull final String firstRowIndex,
@NotNull final String rowIndex,
@NotNull final String columnIndex,
Method buildHeaders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public List<Header> buildHeaders() {
ArrayList<Header> headersArr = new ArrayList<>();
if (!StringUtils.isEmpty(headers)) {
BufferedReader in = new BufferedReader(new StringReader(headers));
- 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 setEbsOptionalQueryParams
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private void setEbsOptionalQueryParams(Map<String, String> queryParamsMap, String[] deviceNamesArray, String[] deleteOnTerminationsArray,
String[] volumeIdsArray, String[] noDevicesArray, String[] virtualNamesArray) {
Method execute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public Map<String, String> execute(@Param(value = EXCEL_FILE_NAME, required = true, description = EXCEL_FILE_NAME_DESC) String excelFileName,
@Param(value = WORKSHEET_NAME, description = WORKSHEET_NAME_DESC) String worksheetName,
@Param(value = ROW_INDEX, description = ROW_INDEX_DESC) String rowIndex,
@Param(value = COLUMN_INDEX, description = COLUMN_INDEX_DESC) String columnIndex,
@Param(value = NEW_VALUE, required = true, description = NEW_VALUE_DESC) String newValue,