fossasia/open-event-orga-server

View on GitHub

Showing 300 of 1,194 total issues

Function query has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def query(self, view_kwargs):
        query_ = UserFavouriteSession.query
        if view_kwargs.get('user_id'):
            user = safe_query_kwargs(User, view_kwargs, 'user_id')
            if user != current_user and not (
Severity: Minor
Found in app/api/user_favourite_sessions.py - About 55 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 before_update_object has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def before_update_object(self, feedback, data, view_kwargs):
        """
        before update object method of feedback details
        :param feedback:
        :param data:
Severity: Minor
Found in app/api/feedbacks.py - About 55 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 require_exclusive_relationship has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def require_exclusive_relationship(resource_list, data, optional=False):
    """Only one of the passed relationships should be present"""
    present = False
    multiple = False
    for resource in resource_list:
Severity: Minor
Found in app/api/helpers/utilities.py - About 55 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 get_credentials has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_credentials(event=None):
        """
        If the event parameter is None, It returns the secret and publishable key of the Admin's Stripe account.
        Else, it returns the corresponding values for the event organizer's account.
        :param event:
Severity: Minor
Found in app/api/helpers/payment.py - About 55 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 export_sales_csv has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def export_sales_csv(sales):
    headers = [
        'Event Name',
        'Owner Name',
        'Owner Email',
Severity: Minor
Found in app/api/helpers/csv_jobs_util.py - About 55 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 export_event_json has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def export_event_json(event_id, settings):
    """
    Exports the event as a zip on the server and return its path
    """
    # make directory
Severity: Minor
Found in app/api/helpers/export_helpers.py - About 55 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 create_object has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def create_object(self, data, view_kwargs):
        identifier = 'identifier'

        if view_kwargs.get('identifier').isdigit():
            identifier = 'id'
Severity: Minor
Found in app/api/data_layers/EventCopyLayer.py - About 55 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 before_get_object has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def before_get_object(self, view_kwargs):
        """
        before get method to get the resource id to fetch details
        :param view_kwargs:
        :return:
Severity: Minor
Found in app/api/event_sub_topics.py - About 55 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 create_file_csv has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def create_file_csv(userCheckIns):
    headers = [
        'Ticket Id',
        'Date Time',
        'Track Name',
Severity: Minor
Found in app/api/helpers/user_check_in.py - About 55 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 event_query has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def event_query(
    query_,
    view_kwargs,
    event_id='event_id',
    event_identifier='event_identifier',
Severity: Minor
Found in app/api/helpers/query.py - About 55 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 change_password has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def change_password():
    old_password = request.json['data']['old-password']
    new_password = request.json['data']['new-password']

    try:
Severity: Minor
Found in app/api/auth.py - About 55 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 uploaded_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def uploaded_file(files, multiple=False):
    if multiple:
        files_uploaded = []
        for file in files:
            extension = file.filename.split('.')[1]
Severity: Minor
Found in app/api/helpers/files.py - About 55 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 before_get_object has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def before_get_object(self, view_kwargs):
        """
        before get method to get the resource id for fetching details
        :param view_kwargs:
        :return:
Severity: Minor
Found in app/api/event_topics.py - About 55 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 print_badge_pdf has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def print_badge_pdf():
    """Print Badge Template PDF"""
    from ..helpers.tasks import create_print_badge_pdf

    if not request.args.get('attendee_id', False):
Severity: Minor
Found in app/api/custom/badge_forms.py - About 55 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 create_save_resized_image has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def create_save_resized_image(
    image_file,
    basewidth=None,
    maintain_aspect=None,
    height_size=None,
Severity: Minor
Found in app/api/helpers/files.py - About 55 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 before_create_object has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def before_create_object(self, data, view_kwargs):
        """
        before create object method for AccessCodeListPost Class
        :param data:
        :param view_kwargs:
Severity: Minor
Found in app/api/access_codes.py - About 55 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 get_track_stats has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_track_stats(track_ids, check_in_attendee, check_out_attendee, current_time):
    """
    get track stats
    @param track_ids: track_ids
    @param check_in_attendee: check_in_attendee
Severity: Minor
Found in app/api/custom/check_in_stats.py - About 55 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 create_save_pdf has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def create_save_pdf(
Severity: Major
Found in app/api/helpers/files.py - About 50 mins to fix

Function send_email_for_monthly_fee_payment has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def send_email_for_monthly_fee_payment(
Severity: Major
Found in app/api/helpers/mail.py - About 50 mins to fix

Function convert_to_user_locale has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def convert_to_user_locale(
Severity: Major
Found in app/api/helpers/mail.py - About 50 mins to fix
Severity
Category
Status
Source
Language