stympy/faker

View on GitHub

Showing 134 of 134 total issues

File omniauth.rb has 408 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Faker
  class Omniauth < Base
    require 'time'
    attr_reader :name,
                :first_name,
Severity: Minor
Found in lib/faker/default/omniauth.rb - About 5 hrs to fix

    Class Company has 36 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Company < Base
        flexible :company
    
        class << self
          ##
    Severity: Minor
    Found in lib/faker/default/company.rb - About 4 hrs to fix

      Method username has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

            def username(legacy_specifier = NOT_GIVEN, legacy_separators = NOT_GIVEN, specifier: nil, separators: %w[. _])
              warn_for_deprecated_arguments do |keywords|
                keywords << :specifier if legacy_specifier != NOT_GIVEN
                keywords << :separators if legacy_separators != NOT_GIVEN
              end
      Severity: Minor
      Found in lib/faker/default/internet.rb - About 4 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 image has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

            def image(legacy_size = NOT_GIVEN, legacy_is_gray = NOT_GIVEN, legacy_category = NOT_GIVEN, legacy_number = NOT_GIVEN, legacy_text = NOT_GIVEN, legacy_secure = NOT_GIVEN, size: '300x300', is_gray: false, category: nil, number: nil, text: nil, secure: true)
              warn_for_deprecated_arguments do |keywords|
                keywords << :size if legacy_size != NOT_GIVEN
                keywords << :is_gray if legacy_is_gray != NOT_GIVEN
                keywords << :category if legacy_category != NOT_GIVEN
      Severity: Minor
      Found in lib/faker/default/lorem_pixel.rb - About 3 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

      Class Internet has 30 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Internet < Base
          # Private, Host, and Link-Local network address blocks as defined in https://en.wikipedia.org/wiki/IPv4#Special-use_addresses
          PRIVATE_IPV4_ADDRESS_RANGES = [
            [10..10,   0..255,   0..255, 1..255], # 10.0.0.0/8     - Used for local communications within a private network
            [100..100, 64..127,  0..255, 1..255], # 100.64.0.0/10  - Shared address space for communications between an ISP and its subscribers
      Severity: Minor
      Found in lib/faker/default/internet.rb - About 3 hrs to fix

        Method image has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

              def image(legacy_size = NOT_GIVEN, legacy_format = NOT_GIVEN, legacy_background_color = NOT_GIVEN, legacy_text_color = NOT_GIVEN, legacy_text = NOT_GIVEN, size: '300x300', format: 'png', background_color: nil, text_color: nil, text: nil)
                warn_for_deprecated_arguments do |keywords|
                  keywords << :size if legacy_size != NOT_GIVEN
                  keywords << :format if legacy_format != NOT_GIVEN
                  keywords << :background_color if legacy_background_color != NOT_GIVEN
        Severity: Minor
        Found in lib/faker/default/placeholdit.rb - About 3 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 twitter has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def twitter(legacy_name = NOT_GIVEN, legacy_nickname = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, nickname: nil, uid: Number.number(digits: 6).to_s)
                warn_for_deprecated_arguments do |keywords|
                  keywords << :name if legacy_name != NOT_GIVEN
                  keywords << :nickname if legacy_nickname != NOT_GIVEN
                  keywords << :uid if legacy_uid != NOT_GIVEN
        Severity: Major
        Found in lib/faker/default/omniauth.rb - About 3 hrs to fix

          Method password has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

                def password(legacy_min_length = NOT_GIVEN, legacy_max_length = NOT_GIVEN, legacy_mix_case = NOT_GIVEN, legacy_special_characters = NOT_GIVEN, min_length: 8, max_length: 16, mix_case: true, special_characters: false)
                  warn_for_deprecated_arguments do |keywords|
                    keywords << :min_length if legacy_min_length != NOT_GIVEN
                    keywords << :max_length if legacy_max_length != NOT_GIVEN
                    keywords << :mix_case if legacy_mix_case != NOT_GIVEN
          Severity: Minor
          Found in lib/faker/default/internet.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

          Class Drone has 25 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Drone < Base
              class << self
                ##
                # Returns random drone name with company
                #
          Severity: Minor
          Found in lib/faker/default/drone.rb - About 2 hrs to fix

            File internet.rb has 279 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module Faker
              class Internet < Base
                # Private, Host, and Link-Local network address blocks as defined in https://en.wikipedia.org/wiki/IPv4#Special-use_addresses
                PRIVATE_IPV4_ADDRESS_RANGES = [
                  [10..10,   0..255,   0..255, 1..255], # 10.0.0.0/8     - Used for local communications within a private network
            Severity: Minor
            Found in lib/faker/default/internet.rb - About 2 hrs to fix

              Method linkedin has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def linkedin(legacy_name = NOT_GIVEN, legacy_email = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, email: nil, uid: Number.number(digits: 6).to_s)
                      warn_for_deprecated_arguments do |keywords|
                        keywords << :name if legacy_name != NOT_GIVEN
                        keywords << :email if legacy_email != NOT_GIVEN
                        keywords << :uid if legacy_uid != NOT_GIVEN
              Severity: Major
              Found in lib/faker/default/omniauth.rb - About 2 hrs to fix

                Class Vehicle has 23 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class Vehicle < Base
                    flexible :vehicle
                
                    MILEAGE_MIN = 10_000
                    MILEAGE_MAX = 90_000
                Severity: Minor
                Found in lib/faker/default/vehicle.rb - About 2 hrs to fix

                  Class Address has 23 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class Address < Base
                      flexible :address
                  
                      class << self
                        ##
                  Severity: Minor
                  Found in lib/faker/default/address.rb - About 2 hrs to fix

                    Method domain_name has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def domain_name(legacy_subdomain = NOT_GIVEN, subdomain: false, domain: nil)
                            warn_for_deprecated_arguments do |keywords|
                              keywords << :subdomain if legacy_subdomain != NOT_GIVEN
                            end
                    
                    
                    Severity: Minor
                    Found in lib/faker/default/internet.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 github has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def github(legacy_name = NOT_GIVEN, legacy_email = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, email: nil, uid: Number.number(digits: 8).to_s)
                            warn_for_deprecated_arguments do |keywords|
                              keywords << :name if legacy_name != NOT_GIVEN
                              keywords << :email if legacy_email != NOT_GIVEN
                              keywords << :uid if legacy_uid != NOT_GIVEN
                    Severity: Major
                    Found in lib/faker/default/omniauth.rb - About 2 hrs to fix

                      Class Opera has 22 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class Opera < Base
                            class << self
                              ##
                              # Produces the title of an opera by Giuseppe Verdi.
                              #
                      Severity: Minor
                      Found in lib/faker/music/opera.rb - About 2 hrs to fix

                        Class Base has 22 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class Base
                            Numbers = Array(0..9)
                            ULetters = Array('A'..'Z')
                            LLetters = Array('a'..'z')
                            Letters = ULetters + LLetters
                        Severity: Minor
                        Found in lib/faker.rb - About 2 hrs to fix

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

                            class IDNumber < Base
                              CHECKS = 'TRWAGMYFPDXBNJZSQVHLCKE'
                              INVALID_SSN = [
                                /0{3}-\d{2}-\d{4}/,
                                /\d{3}-0{2}-\d{4}/,
                          Severity: Minor
                          Found in lib/faker/default/id_number.rb - About 2 hrs to fix

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

                                  def image(legacy_slug = NOT_GIVEN, legacy_size = NOT_GIVEN, legacy_format = NOT_GIVEN, legacy_set = NOT_GIVEN, legacy_bgset = NOT_GIVEN, slug: nil, size: '300x300', format: 'png', set: 'set1', bgset: nil)
                                    warn_for_deprecated_arguments do |keywords|
                                      keywords << :slug if legacy_slug != NOT_GIVEN
                                      keywords << :size if legacy_size != NOT_GIVEN
                                      keywords << :format if legacy_format != NOT_GIVEN
                            Severity: Minor
                            Found in lib/faker/default/avatar.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 user has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def user(legacy_include_status = NOT_GIVEN, legacy_include_email = NOT_GIVEN, include_status: true, include_email: false)
                                    warn_for_deprecated_arguments do |keywords|
                                      keywords << :include_status if legacy_include_status != NOT_GIVEN
                                      keywords << :include_email if legacy_include_email != NOT_GIVEN
                                    end
                            Severity: Major
                            Found in lib/faker/default/twitter.rb - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language