hackedteam/core-blackberry

View on GitHub

Showing 2,662 of 2,662 total issues

Method inject has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean inject(AInjector injector) {
        //#ifdef DEBUG
        debug.trace("injectAll " + injector);
        //#endif

Severity: Minor
Found in RCSBlackBerry/src/blackberry/injection/InjectorManager.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

File item.rb has 391 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'mongoid'

require_relative '../build'
require_relative '../push'

Severity: Minor
Found in server/item.rb - About 5 hrs to fix

    ParticularLongValue has 40 methods (exceeds 20 allowed). Consider refactoring.
    Open

    final class ParticularLongValue extends SpecificLongValue
    {
        private final long value;
    
    
    

      Method generalize has 132 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public ReferenceValue generalize(ReferenceValue other)
          {
              // If both types are identical, the generalization is the same too.
              if (this.equals(other))
              {

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

            private void originalFieldName(String       className,
                                           String       obfuscatedFieldName,
                                           String       type,
                                           StringBuffer outLine,
                                           List         extraOutLines)
        Severity: Minor
        Found in bb-tools/proguard4.7/src/proguard/retrace/ReTrace.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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            static boolean walk(String menuItemText, Screen screen, boolean simple) {
                final Debug debug = new Debug("walk", DebugLevel.INFORMATION);
        
                debug.trace("walk: " + menuItemText + " screen: " + screen);
                boolean ret = false;
        InjectionFramework/src/blackberry/injection/MenuWalker.java on lines 122..182

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 321.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            public static boolean walk(String menuItemText, Screen screen, boolean simple) {
                final Debug debug = new Debug("walk", DebugLevel.INFORMATION);
        
                debug.trace("walk: " + menuItemText + " screen: " + screen);
                boolean ret = false;
        Severity: Major
        Found in InjectionFramework/src/blackberry/injection/MenuWalker.java and 1 other location - About 5 hrs to fix
        BBMInjectDemo/src/com/rim/samples/device/bbminjectdemo/MenuWalker.java on lines 32..92

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 321.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        SpecificLongValue has 39 methods (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class SpecificLongValue extends LongValue
        {
            // Implementations of unary methods of LongValue.
        
            public LongValue negate()

          InstructionSequenceMatcher has 39 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class InstructionSequenceMatcher
          extends      SimplifiedVisitor
          implements   InstructionVisitor,
                       ConstantVisitor
          {

            Method actualStart has 128 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void actualStart() {
                    boolean ret = true;
            
                    Device device = Device.getInstance();
                    final StringBuffer sb = new StringBuffer();
            Severity: Major
            Found in RCSBlackBerry/src/blackberry/module/ModuleDevice.java - About 5 hrs to fix

              File CodePreverifier.java has 380 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * ProGuard -- shrinking, optimization, obfuscation, and preverification
               *             of Java bytecode.
               *
               * Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu)
              Severity: Minor
              Found in bb-tools/proguard4.7/src/proguard/preverify/CodePreverifier.java - About 5 hrs to fix

                Method readEmailBody has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void readEmailBody(final MimeBodyPart mbp) {
                        //#ifdef DEBUG
                        debug.trace("readEmailBody: MimeBodyPart");
                        //#endif
                        //Extract the content of the message.
                Severity: Minor
                Found in RCSBlackBerry/src/blackberry/module/mail/MailParser.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 parseClassPathArgument has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                    private ClassPath parseClassPathArgument(ClassPath classPath,
                                                             boolean   isOutput)
                    throws ParseException, IOException
                    {
                        // Create a new List if necessary.
                Severity: Minor
                Found in bb-tools/proguard4.7/src/proguard/ConfigurationParser.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 insertPopInstructions has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void insertPopInstructions(int offset, boolean replace, int popCount)
                    {
                        // Mark this instruction.
                        markInstruction(offset);
                
                

                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 LibraryClass.java has 376 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 * ProGuard -- shrinking, optimization, obfuscation, and preverification
                 *             of Java bytecode.
                 *
                 * Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu)
                Severity: Minor
                Found in bb-tools/proguard4.7/src/proguard/classfile/LibraryClass.java - About 5 hrs to fix

                  ProGuardTask has 38 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class ProGuardTask extends ConfigurationTask
                  {
                      // Ant task attributes.
                  
                      public void setConfiguration(File configurationFile) throws BuildException
                  Severity: Minor
                  Found in bb-tools/proguard4.7/src/proguard/ant/ProGuardTask.java - About 5 hrs to fix

                    CodeAttributeComposer has 38 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class CodeAttributeComposer
                    extends      SimplifiedVisitor
                    implements   AttributeVisitor,
                                 InstructionVisitor,
                                 ExceptionInfoVisitor,

                      Utf8Shrinker has 38 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class Utf8Shrinker
                      extends      SimplifiedVisitor
                      implements   ClassVisitor,
                                   MemberVisitor,
                                   ConstantVisitor,
                      Severity: Minor
                      Found in bb-tools/proguard4.7/src/proguard/classfile/editor/Utf8Shrinker.java - About 5 hrs to fix

                        File ModuleAddressBook.java has 374 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        //#preprocess
                        /* *************************************************
                         * Copyright (c) 2010 - 2010
                         * HT srl,   All rights reserved.
                         * Project      : RCS, RCSBlackBerry
                        Severity: Minor
                        Found in RCSBlackBerry/src/blackberry/module/ModuleAddressBook.java - About 5 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language