rubinius/rubinius

View on GitHub
core/pointer.rb

Summary

Maintainability
C
1 day
Test Coverage

Class Pointer has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Pointer
      include PointerAccessors

      def initialize(a1, a2=undefined)
        if undefined.equal? a2
Severity: Minor
Found in core/pointer.rb - About 4 hrs to fix

    File pointer.rb has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Rubinius
      module FFI
        # We need to define this so we can include it. Since the file is
        # auto-generated, we can't pull it in here but we don't want to break the
        # alphabetized load order for random cases.
    Severity: Minor
    Found in core/pointer.rb - About 3 hrs to fix

      Method new has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def self.new(type, count=nil, clear=true)
              if type.kind_of? Fixnum
                size = type
              elsif type.kind_of? Symbol
                type = FFI.find_type type
      Severity: Minor
      Found in core/pointer.rb - About 1 hr to fix

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

              def self.new(type, count=nil, clear=true)
                if type.kind_of? Fixnum
                  size = type
                elsif type.kind_of? Symbol
                  type = FFI.find_type type
        Severity: Minor
        Found in core/pointer.rb - 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

        Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def initialize(ret_type, arg_types, val=nil, options=nil, &block)
        Severity: Minor
        Found in core/pointer.rb - About 35 mins to fix

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

                def initialize(ret_type, arg_types, val=nil, options=nil, &block)
                  if block
                    if val or options
                      raise ArgumentError, "specify a block or a proc/address, not both"
                    end
          Severity: Minor
          Found in core/pointer.rb - 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