hackedteam/core-blackberry

View on GitHub
RCSBlackBerry/src/rpc/json/me/JSONTokener.java

Summary

Maintainability
F
3 days
Test Coverage

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

    public char nextClean() throws JSONException {
        for (;;) {
            char c = next();
            if (c == '/') {
                switch (next()) {
Severity: Minor
Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 5 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 nextValue has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public Object nextValue() throws JSONException {
        char c = nextClean();
        String s;

        switch (c) {
Severity: Minor
Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 5 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 nextValue has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Object nextValue() throws JSONException {
        char c = nextClean();
        String s;

        switch (c) {
Severity: Major
Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 2 hrs to fix

    File JSONTokener.java has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    //#preprocess
    
    /* *************************************************
     * Copyright (c) 2010 - 2012
     * HT srl,   All rights reserved.
    Severity: Minor
    Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 2 hrs to fix

      Method nextString has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public String nextString(char quote) throws JSONException {
              char c;
              StringBuffer sb = new StringBuffer();
              for (;;) {
                  c = next();
      Severity: Minor
      Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 1 hr to fix

        Method nextClean has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public char nextClean() throws JSONException {
                for (;;) {
                    char c = next();
                    if (c == '/') {
                        switch (next()) {
        Severity: Minor
        Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 1 hr to fix

          Method nextString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public String nextString(char quote) throws JSONException {
                  char c;
                  StringBuffer sb = new StringBuffer();
                  for (;;) {
                      c = next();
          Severity: Minor
          Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 55 mins 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

          Avoid deeply nested control flow statements.
          Open

                                      if (c == 0) {
                                          throw syntaxError(Messages.getString("2.3")); //$NON-NLS-1$
                                      }
          Severity: Major
          Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (c == '*') {
                                            if (next() == '/') {
                                                break;
                                            }
                                            back();
            Severity: Major
            Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 45 mins to fix

              Method nextTo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public String nextTo(char d) {
                      StringBuffer sb = new StringBuffer();
                      for (;;) {
                          char c = next();
                          if (c == d || c == 0 || c == '\n' || c == '\r') {
              Severity: Minor
              Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 35 mins 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 nextTo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public String nextTo(String delimiters) {
                      char c;
                      StringBuffer sb = new StringBuffer();
                      for (;;) {
                          c = next();
              Severity: Minor
              Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 35 mins 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

              Avoid too many return statements within this method.
              Open

                                      return new Integer(Integer.parseInt(s, 8));
              Severity: Major
              Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return JSONObject.NULL;
                Severity: Major
                Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

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

                    Avoid too many return statements within this method.
                    Open

                                            return Double.valueOf(s);
                    Severity: Major
                    Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                              return new Integer(Integer.parseInt(s.substring(2), 16));
                      Severity: Major
                      Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                            return new Long(Long.parseLong(s));
                        Severity: Major
                        Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

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

                            Avoid too many return statements within this method.
                            Open

                                            return Integer.valueOf(s);
                            Severity: Major
                            Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 30 mins to fix

                              Method dehexchar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static int dehexchar(char c) {
                                      if (c >= '0' && c <= '9') {
                                          return c - '0';
                                      }
                                      if (c >= 'A' && c <= 'F') {
                              Severity: Minor
                              Found in RCSBlackBerry/src/rpc/json/me/JSONTokener.java - About 25 mins 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

                              There are no issues that match your filters.

                              Category
                              Status