ruboto/ruboto

View on GitHub
lib/ruboto/util/build.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Method check_methods has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

      def check_methods(methods, force=nil)
        min_api = verify_min_sdk.to_i
        target_api = verify_target_sdk.to_i

        # Remove methods changed outside of the scope of the sdk versions
Severity: Minor
Found in lib/ruboto/util/build.rb - About 2 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 check_methods has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def check_methods(methods, force=nil)
        min_api = verify_min_sdk.to_i
        target_api = verify_target_sdk.to_i

        # Remove methods changed outside of the scope of the sdk versions
Severity: Minor
Found in lib/ruboto/util/build.rb - About 1 hr to fix

    Method generate_subclass_or_interface has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def generate_subclass_or_interface(params)
            defaults = {:template => 'InheritingClass', :method_base => 'all', :method_include => '', :method_exclude => '', :force => nil, :implements => ''}
            params = defaults.merge(params)
            params[:package] ||= verify_package
    
    
    Severity: Minor
    Found in lib/ruboto/util/build.rb - 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 get_class_or_interface has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def get_class_or_interface(klass, force=nil)
            element = verify_api.find_class_or_interface(klass, 'either')
    
            abort "ERROR: #{klass} not found" unless element
    
    
    Severity: Minor
    Found in lib/ruboto/util/build.rb - 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 build_file has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def build_file(src, package, name, substitutions, dest='.')
    Severity: Minor
    Found in lib/ruboto/util/build.rb - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status