fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/ext/petaf/messages/AcceptMessage.java

Summary

Maintainability
D
2 days
Test Coverage

Method setValue has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean setValue(Object entity, String attribute, Object value, String type) {
        if (attribute == null || entity instanceof AcceptMessage == false) {
            return false;
        }

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 getValue has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public Object getValue(Object entity, String attribute) {
        if (attribute == null || entity instanceof AcceptMessage == false) {
            return null;
        }

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 setValue has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public boolean setValue(Object entity, String attribute, Object value, String type) {
        if (attribute == null || entity instanceof AcceptMessage == false) {
            return false;
        }

    Method getValue has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public Object getValue(Object entity, String attribute) {
            if (attribute == null || entity instanceof AcceptMessage == false) {
                return null;
            }

      Avoid deeply nested control flow statements.
      Open

                              if (modelProxy.getId() == null) {
                                  Object modell = modelProxy.getModel();
                                  if (modell != null && modell.getClass().getName().equals(className)) {
                                      candidates.add(modelProxy);
                                  }

        Avoid too many return statements within this method.
        Open

                        return candidates;

          Avoid too many return statements within this method.
          Open

                  return super.getValue(entity, attribute);

            Avoid too many return statements within this method.
            Open

                            return modelProxy.getModel();

              Avoid too many return statements within this method.
              Open

                      return super.setValue(entity, attribute, value, type);

                Avoid too many return statements within this method.
                Open

                                return true;

                  Avoid too many return statements within this method.
                  Open

                                  return null;

                    Avoid too many return statements within this method.
                    Open

                                        return false;

                      Avoid too many return statements within this method.
                      Open

                                      return true;

                        There are no issues that match your filters.

                        Category
                        Status