Showing 241 of 434 total issues
Function parse_message
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def parse_message(self, message):
action = None
parameters = None
self.cs = self._get_conversation_state()
in_convo = self.cs 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 send_response
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def send_response(self):
if self.fb_id and (self.reply or self.message_data):
message_object = {}
if self.reply and 'attachment' not in self.message_data:
message_object['text'] = self.reply
- 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 safe_add_task
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def safe_add_task(callable, *args, **kwargs):
"""This function guarantees addition of a task to a queue.
It retries safe_add_tasks adding task if any error occurs during task creation.
There are 3 ways to use this function
- 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 trend_data
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
trend_data(day_counts) {
let {iso_dates, habits} = this.state;
let rwindow = [];
let series_data = [];
let labels = [];
Function handle_tag_selected
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
handle_tag_selected(chosenRequest, index) {
let {tags, journal_segments, questions} = this.state;
let {journals} = this.props;
let tag = tags[index];
let aggregate = {};
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {all_showing} = this.state;
let {initially_show} = this.props;
let n_projects = this.count_projects();
let empty = n_projects == 0;
Function render_tag_suggest
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render_tag_suggest(str, qname) {
let {tags_loading} = this.state;
let entering_tag = false;
let _content, _selector;
let last_space = str.lastIndexOf(' ');
Function render_admin_section
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render_admin_section() {
let {form} = this.state;
let {user} = this.props;
let bigquery_dataset_name = null, bigquery_table_name = null;
if (user && user.integrations) {
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {form} = this.state;
let params = clone(form);
if (form.date_from) params.date_from = util.printDateObj(form.date_from);
if (form.date_to) params.date_to = util.printDateObj(form.date_to);
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {goals} = this.props;
let {goal_detail, form, goal_year} = this.state;
let today = new Date();
let goalData = this.goal_data();
Function render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
let {title, subhead, link, details} = this.state;
let {layout, col_order} = this.props;
let cls = "FlashCard " + layout;
let _content, _flipping;
- 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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
let {form} = this.state;
let {fts_url} = this.props;
let _search_box;
var _items = this.state.items.map(function(item, i, arr) {
- 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_tag_suggest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render_tag_suggest(str, qname) {
let {tags_loading} = this.state;
let entering_tag = false;
let _content, _selector;
let last_space = str.lastIndexOf(' ');
- 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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
let {journal, questions} = this.props;
let data = journal.data;
let responses = questions.map((q, i) => {
let q_response = data[q.name];
- 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 Create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def Create(user, title, due=None, tomorrow=None):
if not due:
tz = user.get_timezone()
local_now = tools.local_time(tz)
task_prefs = user.get_setting_prop(['tasks', 'preferences'], {})
- 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 lookupDict
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def lookupDict(item_list, keyprop="key_string", valueTransform=None):
"""
keyprop can be 'key_string', 'key_id', or a property name
if valueProp is None, value at each key is full item from list
otherwise, run specified function to get value to store in dict
- 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 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {user} = this.props;
let {SITENAME} = AppConstants;
let LOGO = <img src="/images/logo_white.png" className="flowlogo glow" width="50" />
let right_icon;
Function get_data
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
get_data() {
let {form, dimensions, snapshots} = this.state;
let {segment_by} = form;
let segment_var = dimensions[segment_by];
if (segment_var) {
Function render_dialog
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render_dialog() {
let {project_dialog_open, updating, form} = this.state;
let editing = form.id != null;
let actions = [
<RaisedButton primary={true} label={editing ? "Update" : "Create"} onClick={this.update_project.bind(this)} disabled={updating} />,
Consider simplifying this complex logical expression. Open
if (open) {
title = readable.title;
if (readable.author) title += ` (${readable.author})`;
actions = [
<RaisedButton primary={true} label="Save" onClick={this.save.bind(this)} disabled={!editing} />,