hackedteam/core-blackberry

View on GitHub
RCSBlackBerry/src/rpc/json/me/util/XML.java

Summary

Maintainability
F
4 days
Test Coverage

Method parse has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean parse(XMLTokener x, JSONObject context, String name)
            throws JSONException {
        char c;
        int i;
        String n;
Severity: Minor
Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 2 days to fix

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 51 (exceeds 5 allowed). Consider refactoring.
Open

    public static String toString(Object o, String tagName)
            throws JSONException {
        StringBuffer b = new StringBuffer();
        int i;
        JSONArray ja;
Severity: Minor
Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 7 hrs to fix

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

    private static boolean parse(XMLTokener x, JSONObject context, String name)
            throws JSONException {
        char c;
        int i;
        String n;
Severity: Major
Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 4 hrs to fix

    Method toString has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static String toString(Object o, String tagName)
                throws JSONException {
            StringBuffer b = new StringBuffer();
            int i;
            JSONArray ja;
    Severity: Major
    Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 2 hrs to fix

      Avoid deeply nested control flow statements.
      Open

                              for (i = 0; i < len; i += 1) {
                                  if (i > 0) {
                                      b.append('\n');
                                  }
                                  b.append(escape(ja.get(i).toString()));
      Severity: Major
      Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 45 mins to fix

        Avoid too many return statements within this method.
        Open

                            return false;
        Severity: Major
        Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                                  return false;
          Severity: Major
          Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return false;
            Severity: Major
            Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return false;
              Severity: Major
              Found in RCSBlackBerry/src/rpc/json/me/util/XML.java - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status