Showing 16 of 50 total issues
File browser.py
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import multiprocessing
from lxml import etree
from PyQt4 import QtCore, QtWebKit, QtGui
from baseBrowser import BaseBrowser, BaseBrowserTab, FrmBaseConfig, FrmBaseSettings
Function setupUi
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setupUi(self, Settings):
Settings.setObjectName("Settings")
Settings.resize(340, 476)
self.groupBox = QtGui.QGroupBox(Settings)
self.groupBox.setGeometry(QtCore.QRect(10, 10, 541, 241))
Function setupUi
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1132, 671)
self.centralwidget = QtGui.QWidget(MainWindow)
font = QtGui.QFont()
OrderedDict
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class OrderedDict(dict):
'Dictionary that remembers insertion order'
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
# The remaining methods are order-aware.
BrowserTab
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class BrowserTab(BaseBrowserTab):
"""
A Browser Tab representation
This class overrides all the methods of the
Function _gen_scrape_method
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _gen_scrape_method(self, sentences):
"""
Generates scrapers methods.
Returns a dictionary containing methods and attributes for the
scraper class.
- 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 update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update(*args, **kwds):
'''od.update(E, **F) -> None. Update od from dict/iterable E and F.
If E is a dict instance, does: for k in E: od[k] = E[k]
If E has a .keys() method, does: for k in E.keys(): od[k] = E[k]
- 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 _fetch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _fetch(self, url, depth_level=0):
"""
Recursive url fetching.
Params:
- 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 _dump_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _dump_file(self, settings_dict):
"""
Writes the settings_dict to a settings.py file
"""
SEPARATOR = " = "
- 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 setupUi
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setupUi(self, FrmConfig):
FrmConfig.setObjectName("FrmConfig")
FrmConfig.resize(400, 131)
self.bt_ok = QtGui.QPushButton(FrmConfig)
self.bt_ok.setGeometry(QtCore.QRect(310, 100, 81, 27))
Function parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse(self):
blocks = []
lines = []
- 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 gen_entities
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def gen_entities(self):
"""
Generates the entities classes
"""
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, port=25, user=None, password=None, enable_ssl=True):
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, parent, settings):
"""
Setups the frm settings window
"""
- 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 get_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_response(self, request, data):
"""
Tries [MAX_TRIES] times to get the response and
return the response data
"""
- 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 _validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _validate(self, response):
"""
Override this method in order to provide more validations before the data extraction with the given scraper class
"""
- 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"