Showing 26 of 26 total issues

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

def pagination_peewee(count_all, query, page_size, cur_page=1, nearby=2):
Severity: Minor
Found in src/model_peewee/__init__.py - About 35 mins to fix

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

        def post(self):
            username = self.get_argument("username")
            password = self.get_argument("password")
            password_again = self.get_argument("password_again")
            next = self.get_argument('next', None)
    Severity: Minor
    Found in src/view/user.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

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

        def render(self, fn=None, **kwargs):
            if not fn:
                fn = ('/%s/%s.html' % (
                    '/'.join(self.__module__.split('.')[1:-1]), 
                    self.__class__.__name__.lower()
    Severity: Minor
    Found in src/view/__init__.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
    Severity: Major
    Found in fpage.py - About 30 mins to fix

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

      def gen(project_dir, project_name, tmpl_engine, db_orm):
          shutil.copytree(join(src_dir, 'src'), project_dir)
      
          if tmpl_engine == 'mako':
              shutil.rmtree(join(project_dir, 'templates_jinja2'))
      Severity: Minor
      Found in fpage.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

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

          def post(self):
              username = self.get_argument("username")
              password = self.get_argument("password")
              remember = self.get_argument('remember', False)
              next = self.get_argument('next', None)
      Severity: Minor
      Found in src/view/user.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