Method validateSelectedNodes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void validateSelectedNodes(User deletingUser, HierarchyNode parent, String[] nodes)
throws SQLException, GeneralSecurityException, UnsupportedEncodingException {
for (String thisNodeId : nodes) {
if (thisNodeId != null && thisNodeId.startsWith("p_")) {
thisNodeId = hierarchyNodeDAO.getNodeIDForObject(parent.getNodeId(), thisNodeId.substring(2));
- 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 deleteSpecifiedNodes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void deleteSpecifiedNodes(User deletingUser, HierarchyNode parent, String[] nodes)
throws GeneralSecurityException, SQLException, IOException {
for (String thisNodeId : nodes) {
if (thisNodeId != null && thisNodeId.startsWith("p_")) {
thisNodeId = hierarchyNodeDAO.getNodeIDForObject(parent.getNodeId(), thisNodeId.substring(2));
- 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 isNotDeletableByUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private boolean isNotDeletableByUser(final User user, final HierarchyNode node)
throws SQLException, GeneralSecurityException, UnsupportedEncodingException {
if(node.getType() == HierarchyNode.OBJECT_NODE) {
AccessControl ac = AccessControlDAO.getInstance().getAccessControl(user, node.getName());
return (ac != null && ac.getModifyKey() != null);
- 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"