pilosus/ForgeryPy3

View on GitHub

Showing 15 of 33 total issues

Function text has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def text(length=None, at_least=10, at_most=15, lowercase=True,
         uppercase=True, digits=True, spaces=True, punctuation=False):
    """
    Return random text.

Severity: Minor
Found in forgery_py/forgery/basic.py - 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

Function text has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def text(what="sentence", *args, **kwargs):
    """An aggregator for all above defined public methods."""

    if what == "character":
        return character(*args, **kwargs)
Severity: Minor
Found in forgery_py/forgery/lorem_ipsum.py - 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

Function text has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def text(length=None, at_least=10, at_most=15, lowercase=True,
Severity: Major
Found in forgery_py/forgery/basic.py - About 1 hr to fix

    Function password has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def password(at_least=6, at_most=12, lowercase=True,
    Severity: Major
    Found in forgery_py/forgery/basic.py - About 50 mins to fix

      Function paragraphs has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def paragraphs(quantity=2, separator='\n\n', wrap_start='', wrap_end='',
      Severity: Major
      Found in forgery_py/forgery/lorem_ipsum.py - About 50 mins to fix

        Function body has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def body(quantity=2, separator='\n\n', wrap_start='', wrap_end='',
        Severity: Major
        Found in forgery_py/forgery/email.py - About 50 mins to fix

          Function check_digit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def check_digit(num):
              """Return a check digit of the given credit card number.
          
              Check digit calculated using Luhn algorithm ("modulus 10")
              See: http://www.darkcoding.net/credit-card/luhn-formula/
          Severity: Minor
          Found in forgery_py/forgery/credit_card.py - About 45 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

          Function paragraph has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def paragraph(separator='\n\n', wrap_start='', wrap_end='',
          Severity: Minor
          Found in forgery_py/forgery/lorem_ipsum.py - About 35 mins to fix

            Function paragraphs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def paragraphs(quantity=2, separator='\n\n', wrap_start='', wrap_end='',
                           html=False, sentences_quantity=3, as_list=False):
                """Return random paragraphs."""
                if html:
                    wrap_start = '<p>'
            Severity: Minor
            Found in forgery_py/forgery/lorem_ipsum.py - 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

            Avoid too many return statements within this function.
            Open

                    return sentence(*args, **kwargs)
            Severity: Major
            Found in forgery_py/forgery/lorem_ipsum.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return paragraphs(*args, **kwargs)
              Severity: Major
              Found in forgery_py/forgery/lorem_ipsum.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return sentences(*args, **kwargs)
                Severity: Major
                Found in forgery_py/forgery/lorem_ipsum.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return paragraph(*args, **kwargs)
                  Severity: Major
                  Found in forgery_py/forgery/lorem_ipsum.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return title(*args, **kwargs)
                    Severity: Major
                    Found in forgery_py/forgery/lorem_ipsum.py - About 30 mins to fix

                      Function number has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def number(type=None, length=None, prefixes=None):
                          """
                          Return a random credit card number.
                      
                          :param type: credit card type. Defaults to a random selection.
                      Severity: Minor
                      Found in forgery_py/forgery/credit_card.py - 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