Arcath/Adauth

View on GitHub

Showing 5 of 5 total issues

Class AdObject has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

    class AdObject
        include Expects

        def self.method_missing(method, *args)
          return super unless method =~ /^find_by_/
Severity: Minor
Found in lib/adauth/ad_object.rb - About 2 hrs to fix

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

            def bind
                conn = Net::LDAP.new :host => @config[:server],
                                     :port => @config[:port],
                                     :base => @config[:base]
                if @config[:encryption]
    Severity: Minor
    Found in lib/adauth/connection.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 cn_groups_nested has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def cn_groups_nested
              @cn_groups_nested = cn_groups
              cn_groups.each do |group|
                ado = Adauth::AdObjects::Group.where('name', group).first
                if ado
    Severity: Minor
    Found in lib/adauth/ad_object.rb - 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

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

            def members
                unless @members
                    @members = []
                    [Adauth::AdObjects::Computer, Adauth::AdObjects::OU, Adauth::AdObjects::User, Adauth::AdObjects::Group].each do |object|
                        object.all.each do |entity|
    Severity: Minor
    Found in lib/adauth/ad_object.rb - 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

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

            def dn_ous
                unless @dn_ous
                    @dn_ous = []
                    @ldap_object.dn.split(/,/).each do |entry|
                        @dn_ous.push entry.gsub(/OU=/, '').gsub(/CN=/,'') if entry =~ /OU=/ or entry == "CN=Users"
    Severity: Minor
    Found in lib/adauth/ad_object.rb - 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

    Severity
    Category
    Status
    Source
    Language