Showing 151 of 272 total issues
File globals.py
has 998 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2018 Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import argparse
File thread.py
has 949 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2018 Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import argparse
Function flush
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
def flush(self):
"""
write out all queued write-commands in order, each one in a separate
:meth:`atomic <notmuch2.Database.atomic>` transaction.
- Read upRead up
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
File envelope.py
has 668 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2018 Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import argparse
File ui.py
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import logging
import os
Function complete
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
def complete(self, original, pos):
# remember how many preceding space characters we see until the command
# string starts. We'll continue to complete from there on and will add
# these whitespaces again at the very end
whitespaceoffset = len(original) - len(original.lstrip())
- Read upRead up
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 keypress
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def keypress(self, size, key):
# if we tabcomplete
if key in ['tab', 'shift tab'] and self.completer:
# if not already in completion mode
if self.completions is None:
- Read upRead up
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
File manager.py
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import importlib.util
import itertools
File helper.py
has 441 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2017-2018 Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
File utils.py
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
# encoding=utf-8
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2017 Dylan Baker <dylan@pnwbakers.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
Function _input_filter
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def _input_filter(self, keys, raw):
"""
handles keypresses.
This function gets triggered directly by class:`urwid.MainLoop`
upon user input and is supposed to pass on its `keys` parameter
- Read upRead up
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 apply
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def apply(self, ui):
tbuffer = ui.current_buffer
# set message/reply indentation if changed
if self.indent is not None:
- Read upRead up
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 read_config
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def read_config(configpath=None, specpath=None, checks=None,
report_extra=False):
"""
get a (validated) config object for given config file path.
- Read upRead up
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
ThreadBuffer
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class ThreadBuffer(Buffer):
"""displays a thread as a tree of messages."""
modename = 'thread'
File thread.py
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
"""
Widgets specific to thread mode
File manager.py
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
from collections import deque
Function construct_header_pile
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def construct_header_pile(self, headers=None, normalize=True):
mail = self._message.get_email()
lines = []
if headers is None:
- Read upRead up
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 construct_mail
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def construct_mail(self):
"""
Compiles the information contained in this envelope into a
:class:`email.Message`.
"""
- Read upRead up
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 parse_escapes_to_urwid
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def parse_escapes_to_urwid(text, default_attr=None, default_attr_focus=None,
parse_background=True):
"""This function converts a text with ANSI escape for terminal
attributes and returns a list containing each part of text and its
corresponding Urwid Attributes object, it also returns a dictionary which
- Read upRead up
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
Message
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Message:
"""
a persistent notmuch message object.
It it uses a :class:`~alot.db.DBManager` for cached manipulation
and lazy lookups.