Showing 5,781 of 10,536 total issues
Avoid too many return
statements within this function. Open
return {k: v for k, v in result.items() if start_datetime_utc <= k <= end_datetime_utc}
Avoid too many return
statements within this function. Open
return list(), None, None, None, None, None, None
Avoid too many return
statements within this function. Open
return
Function detectVerticalSquash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var detectVerticalSquash = function detectVerticalSquash(img) {
var iw = img.naturalWidth;
var ih = img.naturalHeight;
var canvas = document.createElement("canvas");
canvas.width = 1;
- 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 getValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getValue: function(value) {
var lengthes = [],
fullLength = 0,
l,
i = 0,
- 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 Notifications
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Notifications = ({ items = rawNotifications.length, children }) => {
const { loading, data: notifications, setData: setNotifications } = useFakeFetch(rawNotifications);
const [settingsIsOpen, setSettingsIsOpen] = useState(false);
const toggleSettingsModal = () => setSettingsIsOpen(!settingsIsOpen);
- 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 WizardInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const WizardInput = ({
label,
id,
name,
errors,
- 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 minimalizaSidebar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function minimalizaSidebar($timeout) {
return {
restrict: 'A',
template: '<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="" ng-click="minimalize()"><i class="fa fa-bars"></i></a>',
controller: function ($scope, $element) {
- 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 Invoice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Invoice = () => {
const [subtotal, setSubtotal] = useState(0);
const [tax, setTax] = useState(0);
const [total, setTotal] = useState(0);
const { loading: invoiceLoading, data: invoice } = useFakeFetch(rawInvoice);
- 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 numberFormatter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const numberFormatter = (number, fixed = 2) => {
// Nine Zeroes for Billions
return Math.abs(Number(number)) >= 1.0e9
? (Math.abs(Number(number)) / 1.0e9).toFixed(fixed) + 'B'
: // Six Zeroes for Millions
- 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 LastMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const LastMessage = (lastMessage, thread) => {
const { users } = useContext(ChatContext);
const user = users.find(({ id }) => id === lastMessage?.senderUserId);
const name = user?.name.split(' ');
const lastMassagePreview =
- 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 IconStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const IconStatus = ({ id }) => {
const { feeds, feedDispatch } = useContext(FeedContext);
const [active, setActive] = useState(false);
const targetedFeed = feeds.find(feed => feed.id === id);
- 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 RegistrationForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const RegistrationForm = ({ setRedirect, setRedirectUrl, layout, hasLabel }) => {
// State
const [name, setName] = useState('');
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
- 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 ProductAdd
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ProductAdd = () => {
const { products, productsDispatch } = useContext(ProductContext);
const [title, setTitle] = useState('');
const [category, setCategory] = useState('Camera');
const [files, setFiles] = useState([]);
- 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 EnergyStoragePowerStationTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const EnergyStoragePowerStationTable = ({ setIsSelected, energyStoragePowerStationList, t }) => {
const { currency } = useContext(AppContext);
const energyFormatter = amount => <Fragment>{amount} kWh</Fragment>;
const capacityFormatter = amount => <Fragment>{amount} kWh</Fragment>;
const powerFormatter = amount => <Fragment>{amount} kW</Fragment>;
- 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 MicrogridDetails
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MicrogridDetails = ({ setRedirect, setRedirectUrl, t }) => {
const location = useLocation();
const microgridUUID = location.search.split('=')[1];
const { currency } = useContext(AppContext);
- 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 KanbanContainer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const KanbanContainer = () => {
const { kanbanColumns, UpdateColumnData, modalContent, modal, setModal } = useContext(KanbanContext);
const containerRef = useRef(null);
// Detect device
- 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 generate_excel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_excel(report, space_name, energy_category_name, reporting_start_datetime_local,
reporting_end_datetime_local, language):
trans = get_translation(language)
trans.install()
- 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 int16_to_hhmm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def int16_to_hhmm(actual_value):
"""Convert int16 to time in HH:mm"""
hh = int(actual_value / 256)
if hh < 10:
hh = '0' + str(hh)
- 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 on_post
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_post(req, resp, id_):
"""Handles POST requests"""
admin_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
- 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"