Showing 239 of 667 total issues
Function useShortenedLink
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useShortenedLink = (url: string, accessToken: string) => {
const [shortenedLink, setShortenedLink] = useState<string>(url);
const [error, setError] = useState<Error | null>(null);
useEffect(() => {
Function show
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
show: function (e) {
if (this.isShowing) return;
// Create a click proxy that is private to this instance of datepicker, for unbinding
this._outsideClickProxy = $.proxy(function (e) {
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: (cluster: Cluster) => {
// Accept the entire Cluster object
const { count, position, markers = [] } = cluster;
const customMarkers = markers as CustomMarker[];
Function BackButton
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BackButton = () => {
const { t } = useTranslation();
const handleCalendarGoBack = useCalendarBackNavigation();
const { previousUserSettings } = useMapParams();
Function extraReducers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
extraReducers: (builder) => {
builder.addCase(fetchTimelapseData.pending, (state) => {
state.status = StatusEnum.Pending;
state.isLoading = true;
state.error = null;
Function useCalendarBackNavigation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useCalendarBackNavigation = () => {
const navigate = useNavigate();
const isMobile = useMobileDetection();
const { currentUserSettings, previousUserSettings, searchParams } =
Function EventManager
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var EventManager = new (function () {
var events = {};
var happened = [];
this.publish = function (name, data) {
Function updateView
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateView: function () {
if (this.timePicker) {
this.renderTimePicker("left");
this.renderTimePicker("right");
if (!this.endDate) {
Method up
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def up
Session.transaction do
Session
.all
.select { |s| !s.timezone_offset }
Function YearPickerButtons
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const YearPickerButtons = () => {
const dispatch = useAppDispatch();
const { timeFrom, updateTime } = useMapParams();
const handleYear = useCallback(
Consider simplifying this complex logical expression. Open
if (
!this.singleDatePicker &&
this.leftCalendar.month &&
this.rightCalendar.month &&
(this.startDate.format("YYYY-MM") ==
Function infoWindow
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const infoWindow = () => {
var InfoWindow = function () {
this.popup = new google.maps.InfoWindow();
};
- 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 processes_pids
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def processes_pids
pids = []
sidekiq_roles = Array(fetch(:sidekiq_role))
sidekiq_roles.each do |role|
next unless host.roles.include?(role)
- 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 DesktopHeader
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const DesktopHeader: React.FC<DesktopHeaderProps> = ({
isMapPage,
isTimelapseView,
navMenuVisible,
toggleMenuVisibility,
- 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
Avoid deeply nested control flow statements. Open
if (ampm === "PM" && hour < 12) hour += 12;
Method sync
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sync(session_data)
tag_list = session_data[:tag_list] || ''
session_data =
session_data.merge(tag_list: SessionBuilder.normalize_tags(tag_list))
- 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 getPlotOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getPlotOptions = (
fixedSessionTypeSelected: boolean,
streamId: number | null,
dispatch: any,
isIndoorParameterInUrl: boolean
- 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
Avoid deeply nested control flow statements. Open
if (ampm === "AM" && hour === 12) hour = 0;
Function TagsInput
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const TagsInput = () => {
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 SessionsListTile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const SessionsListTile: React.FC<SessionListTile> = ({
id,
sessionName,
sensorName,
averageValue,
- 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"