Method mapChildren
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
protected void mapChildren(DesktopCtrl desktopCtrl, List<String> uuids, List<String[]> idmap, List<Object[]> evtmap,
Component comp) {
for (Component p = comp.getFirstChild(); p != null; p = p.getNextSibling()) {
if (p instanceof StubsComponent) {
final String[] kiduuids = ((StubsComponent) p)._uuids;
- 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 toString
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public String toString() {
final StringBuffer sb = new StringBuffer(super.toString());
if (_uuids != null) {
sb.append('(');
for (int j = 0; j < _uuids.length; ++j) {
- 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 service
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public void service(Event event, Scope scope) throws Exception {
final StubEvent stubevt = event instanceof StubEvent ? (StubEvent) event : null;
final String uuid = stubevt != null ? stubevt.getUuid() : null;
if (uuid == null || uuid.equals(getUuid())) {
super.service(event, scope);
- 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 mapChildren
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void mapChildren(DesktopCtrl desktopCtrl, List<String> uuids, List<String[]> idmap, List<Object[]> evtmap,
Component comp) {
for (Component p = comp.getFirstChild(); p != null; p = p.getNextSibling()) {
if (p instanceof StubsComponent) {
final String[] kiduuids = ((StubsComponent) p)._uuids;
Avoid deeply nested control flow statements. Open
for (Object[] evtinf : kidevts)
evtmap.add(evtinf);
Avoid deeply nested control flow statements. Open
if (desktopCtrl != null)
desktopCtrl.mapComponent(uuid, this);
Method mapChildren
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected void mapChildren(DesktopCtrl desktopCtrl, List<String> uuids, List<String[]> idmap, List<Object[]> evtmap,
Component comp) {
Method getId
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public String getId(String uuid) {
if (_idmap != null)
for (String[] idinf : _idmap)
if (uuid.equals(idinf[0]))
return idinf[1];
- 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"