Method wireOthers
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
private void wireOthers(Object x) {
//check methods
final Class cls = _controller.getClass();
Method[] mtds = cls.getMethods();
for (int j = 0; j < mtds.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
File ConventionWire.java
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ConventionWire.java
Purpose:
Description:
Method getVariable
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private Object getVariable(Object x, String fdname) {
//#feature 2770471 GenericAutowireComposer shall support wiring ZScript varible
if (x instanceof Page) {
final Page page = (Page) x;
Object arg = _ignoreZScript ? null : page.getZScriptVariable(fdname);
- 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 injectByMethod
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private boolean injectByMethod(Method md, Class<?> parmcls, Class<?> argcls, Object arg, String fdname) {
if (argcls == null || parmcls.isAssignableFrom(argcls)) {
final Field fd = _fldMaps.get(fdname);
if (fd != null && fd.getType().equals(parmcls)) {
final boolean old = fd.isAccessible();
- 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
Consider simplifying this complex logical expression. Open
if (x instanceof Page) {
final Page page = (Page) x;
return (!_ignoreZScript && page.getZScriptVariable(fdname) != null)
|| page.hasAttributeOrFellow(fdname, true)
|| (!_ignoreXel && page.getXelVariable(null, null, fdname, true) != null);
Method injectByName
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private void injectByName(Object arg, String fdname, boolean fieldOnly) {
//argument to be injected is null; then no need to inject
if (arg != null) {
final String mdname = Classes.toMethodName(fdname, "set");
final Class parmcls = arg.getClass();
- 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 wireFellows
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public void wireFellows(final IdSpace idspace) {
//inject fellows
final Collection<Component> fellows = idspace.getFellows();
for (Component xcomp : fellows)
injectFellow(xcomp);
- 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 wireOthers
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void wireOthers(Object x) {
//check methods
final Class cls = _controller.getClass();
Method[] mtds = cls.getMethods();
for (int j = 0; j < mtds.length; ++j) {
Method injectByMethod
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean injectByMethod(Method md, Class<?> parmcls, Class<?> argcls, Object arg, String fdname) {
if (argcls == null || parmcls.isAssignableFrom(argcls)) {
final Field fd = _fldMaps.get(fdname);
if (fd != null && fd.getType().equals(parmcls)) {
final boolean old = fd.isAccessible();
Avoid deeply nested control flow statements. Open
if (arg2 != arg && arg2 != null)
injectField(arg2, arg2.getClass(), fd);
Method containsVariable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private boolean containsVariable(Object x, String fdname) {
//#feature 2770471 GenericAutowireComposer shall support wiring ZScript varible
if (x instanceof Page) {
final Page page = (Page) x;
return (!_ignoreZScript && page.getZScriptVariable(fdname) != 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"
Further reading
Avoid deeply nested control flow statements. Open
if (containsVariable(x, fdname)) {
final Object arg = getVariable(x, fdname);
if (!injectByMethod(md, parmcls[0], arg == null ? null : arg.getClass(), arg, fdname)) {
final Object arg2 = getFellow(x, fdname);
if (arg2 != arg && arg2 != null)
Method injectByMethod
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private boolean injectByMethod(Method md, Class<?> parmcls, Class<?> argcls, Object arg, String fdname) {
Method wireImplicit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
public void wireImplicit(Object x) {
//Feature #3315689
if (ignoreFromWire(_controller.getClass()))
return;
- 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"