Net-ng/kansha

View on GitHub

Showing 327 of 327 total issues

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

    def get_class(self):
        '''Get its css class depending on the amount of time between today and the value'''
        if not self.due_date:
            return ''
        diff = self.get_days_count()
Severity: Minor
Found in kansha/card_addons/due_date/comp.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 render_CardLabels_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def render_CardLabels_list(self, h, comp, model):
    """Show labels inline for card edit view"""
    with h.div(class_='editable-labels'):
        for label in self.get_available_labels():
            label_model = 'color' if label in self.labels else 'inactive'
Severity: Minor
Found in kansha/card_addons/label/view.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 validate_sequence has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_sequence(self, value):
        try:
            res = validator.StringValidator(value, strip=True).not_empty(msg=i18n._("Required field")).to_string()
        except ValueError:
            raise
Severity: Minor
Found in kansha/board/boardconfig.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 search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def search(self, query):
        self.last_search = query
        if query:
            condition = self.card_schema.match(query) & (self.card_schema.board_id == self.board_id)
            # do not query archived cards if archive column is hidden
Severity: Minor
Found in kansha/board_card_filter/comp.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 render_boardweights_edit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def render_boardweights_edit(self, h, comp, *args):
    """Render the weights configuration panel"""
    with h.div(class_='panel-section'):
        h << h.div(_(u'Weighting cards'), class_='panel-section-title')
        h << h.p(_(u'Activate cards weights'))
Severity: Minor
Found in kansha/board/view.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 send has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def send(self, subject, to, content, html_content=None, from_='', cc=[], bcc=[],
             type='plain', mpart_type='alternative'):
        """Sends an email

        In:
Severity: Minor
Found in kansha/services/mail.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 render_num_matches has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def render_num_matches(self, h, comp, *args):
    local_h = h.SyncRenderer()
    input_class = ''
    if self.card_matches:
        if None in self.card_matches:
Severity: Minor
Found in kansha/board_card_filter/view.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