Showing 241 of 434 total issues
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {form, editing_journal, editor_form} = this.state;
let {user} = this.props;
let journal_qs = get(user, 'settings.journals.questions', []);
let params = clone(form);
Function update
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def update(self, d):
id = self.request.get('id')
params = tools.gets(self,
integers=['type', 'word_count'],
strings=['notes', 'title', 'url', 'author', 'source', 'excerpt'],
- 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_setting_prop
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_setting_prop(self, path, default=None):
settings = tools.getJson(self.settings)
if settings:
cursor = settings
for i, pi in enumerate(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
Function Update
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def Update(self, **params):
if 'read' in params:
change = self.read != params.get('read')
self.read = params.get('read')
if change and self.read:
- 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 render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {more} = this.state;
let {user} = this.props;
let journal_qs = [];
let journal_location = false;
ProjectViewer
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@connectToStores
@changeHandler
export default class ProjectViewer extends React.Component {
static propTypes = {
due_soon_days: PropTypes.number,
Integrations
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@connectToStores
@changeHandler
export default class Integrations extends React.Component {
static defaultProps = {};
constructor(props) {
Reading
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@connectToStores
@changeHandler
export default class Reading extends React.Component {
static defaultProps = {};
constructor(props) {
Report
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Report(ndb.Model):
"""
Key - ID
"""
dt_created = ndb.DateTimeProperty(auto_now_add=True)
Function productivity_data
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
productivity_data() {
let {tracking_days, iso_dates, user} = this.props;
let {readables_read} = this.state;
let labels = [];
let commit_data = [];
Function render
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {form} = this.state;
return (
<div>
Function add_message_from_user
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_message_from_user(self, from_user):
success = True
if self.next_expected_pattern:
m = re.match(self.next_expected_pattern, from_user)
if m and self.next_store_key:
- 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 render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let t = this.props.task;
let inner;
if (!t) inner = <span></span>
else {
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {loaded} = this.props;
let {form} = this.state
if (!this.have_data()) return <div className="empty">Loading</div>
let {habit_data, day_counts} = this.habit_data();
Function CreateOrUpdate
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def CreateOrUpdate(user, source_id, title=None, url=None,
Function task_data
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
task_data() {
let {iso_dates, tasks} = this.props;
let completed_on_time = [];
let completed_late = [];
Function Update
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def Update(self, **params):
if 'urls' in params:
self.urls = params.get('urls')
if 'title' in params:
self.title = params.get('title')
- 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_books_on_shelf
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_books_on_shelf(user, shelf='currently-reading'):
'''
Return JSON array {title, author, isbn, image}
'''
user_id = user.get_integration_prop('goodreads_user_id')
- 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 lookup_readable
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def lookup_readable(self, user):
USE_FTS = True
if self.source:
if USE_FTS:
# Lookup via readable full-text-search
- 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 submit
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def submit(self, d):
'''
Submit today's journal (yesterday if 00:00 - 04:00)
'''
date = 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"