File core.py
has 791 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
Function explore
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def explore(
self,
datasource_type: str | None = None,
datasource_id: int | None = None,
key: str | None = 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 save_or_overwrite_slice
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def save_or_overwrite_slice(
# pylint: disable=too-many-arguments,too-many-locals
slc: Slice | None,
slice_add_perm: bool,
slice_overwrite_perm: bool,
- 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 explore_json
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def explore_json(
self, datasource_type: str | None = None, datasource_id: int | None = None
) -> FlaskResponse:
"""Serves all request that GET or POST form_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 explore
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def explore(
self,
datasource_type: str | None = None,
datasource_id: int | None = None,
key: str | None = None,
Function warm_up_cache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def warm_up_cache(self) -> FlaskResponse:
"""Warms up the cache for the slice or table.
Note for slices a force refresh occurs.
- 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 save_or_overwrite_slice
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_or_overwrite_slice(
# pylint: disable=too-many-arguments,too-many-locals
slc: Slice | None,
slice_add_perm: bool,
slice_overwrite_perm: bool,
Function save_or_overwrite_slice
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_or_overwrite_slice(
Avoid too many return
statements within this function. Open
return self.generate_json(viz_obj, response_type)
Avoid too many return
statements within this function. Open
return json_error_response(
Avoid too many return
statements within this function. Open
return self.send_data_payload_response(viz_obj, payload)
Avoid too many return
statements within this function. Open
return self.save_or_overwrite_slice(
Avoid too many return
statements within this function. Open
return json_error_response(
Avoid too many return
statements within this function. Open
return self.render_template(
Avoid too many return
statements within this function. Open
return json_error_response(utils.error_msg_from_exception(ex), 400)
Function dashboard_permalink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dashboard_permalink(
self,
key: str,
) -> FlaskResponse:
try:
- 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"