Showing 239 of 667 total issues
Avoid too many return
statements within this function. Open
return "default";
Avoid too many return
statements within this function. Open
if (!data.gridResolution) return false;
Avoid too many return
statements within this function. Open
return {
west: bounds.west,
east: bounds.east,
south: bounds.south,
north: bounds.north,
Method authenticate_admin_user!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def authenticate_admin_user!
redirect_to(new_user_session_path) && return unless current_user
redirect_to(new_user_session_path) && return unless current_user.admin?
end
- 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
Method change
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def change
if column_exists?(:sessions, :timezone_offset)
remove_column :sessions, :timezone_offset
end
if column_exists?(:sessions, :os_version)
- 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 setSensor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const setSensor = (
selectedParameter: ParameterType,
sensors: Sensor[],
sessionType: string
) => {
- 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 EventManager
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var EventManager = new (function () {
var events = {};
var happened = [];
this.publish = function (name, 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
Method prepare_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prepare_data(params)
if params[:q].is_a?(String)
data =
ActiveSupport::JSON.decode(params.to_unsafe_hash[:q]).symbolize_keys
else
- 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 drawSession
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const drawSession = () => {
let DrawSession = function () {};
DrawSession.prototype = {
drawMobileSession: function (session, drawSessionStartingMarker) {
- 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 params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const params = () => {
var Params = function () {
this.init(getParams2());
};
Params.prototype = {
- 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
Method sign_in_and_redirect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sign_in_and_redirect(resource_or_scope, resource = nil)
scope = Devise::Mapping.find_scope!(resource_or_scope)
resource ||= resource_or_scope
sign_in(scope, resource) unless warden.user(scope) == resource
if resource.admin?
- 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 useMapEventListeners
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const useMapEventListeners = (
map: google.maps.Map | null,
eventHandlers: { [eventName: string]: () => void }
) => {
useEffect(() => {
- 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 applyStyles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private applyStyles() {
if (!this.div) return;
const size = this.isSelected ? 44 : 36;
const blurValue = this.isSelected ? 0 : 3;
- 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
Method delete_session_streams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_session_streams
GoogleAnalyticsWorker::RegisterEvent.async_call(
'User Sessions#delete session streams'
)
session_data = decode_and_deep_symbolize(params)
- 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 LocationSearch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const LocationSearch: React.FC<LocationSearchProps> = ({
isMapPage,
isTimelapseView,
}) => {
const dispatch = useAppDispatch();
- 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 CalendarPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const CalendarPage: React.FC<CalendarPageProps> = ({ children }) => {
const dispatch = useAppDispatch();
const isMobile = useMobileDetection();
const { t } = useTranslation();
const handleCalendarGoBack = useCalendarBackNavigation();
- 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 ProfileNamesInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ProfileNamesInput = () => {
const [items, setItems] = useState<string[]>([""]);
const [inputValue, setInputValue] = useState<string>("");
const [selectedItem, setSelectedItem] = useState<string>("");
const dispatch = useAppDispatch();
- 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 useScrollEndListener
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const useScrollEndListener = (
elementRef: React.RefObject<HTMLElement>,
onScrollEnd: () => void
) => {
useEffect(() => {
- 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 ScrollCalendarButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ScrollCalendarButton: React.FC<ScrollButtonComponentProps> = ({
direction,
handleClick,
disabled = false,
}) => {
- 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"