Showing 5,781 of 10,536 total issues
Function CookieNotice
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CookieNotice = () => {
const [visible, setVisible] = useState(false);
const onDismiss = () => setVisible(false);
return (
File equipment_energy_input_item.py
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import time
from datetime import datetime, timedelta
from decimal import Decimal
from multiprocessing import Pool
Function BillingContent
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BillingContent = () => {
const [method, setMethod] = useState('card');
const [cardNumber, setCardNumber] = useState('');
const [cardName, setCardName] = useState('');
const [country, setCountry] = useState('United States');
Function Emitter
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
function () {
function Emitter() {
_classCallCheck(this, Emitter);
}
- 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 36 (exceeds 5 allowed). Consider refactoring. Open
def on_post(req, resp):
if 'API-KEY' not in req.headers or \
not isinstance(req.headers['API-KEY'], str) or \
len(str.strip(req.headers['API-KEY'])) == 0:
access_control(req)
- 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_put
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def on_put(req, resp):
"""Handles PUT requests"""
try:
raw_json = req.stream.read().decode('utf-8')
new_values = json.loads(raw_json)
- 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 start
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start() {
if (animationClosed) return;
if (!node.parentNode) {
close();
return;
Function on_get
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_get(req, resp):
if 'API-KEY' not in req.headers or \
not isinstance(req.headers['API-KEY'], str) or \
len(str.strip(req.headers['API-KEY'])) == 0:
access_control(req)
File tenant_energy_input_item.py
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import time
from datetime import datetime, timedelta
from decimal import Decimal
from multiprocessing import Pool
File equipment_energy_output_category.py
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import time
from datetime import datetime, timedelta
from decimal import Decimal
from multiprocessing import Pool
File equipment_energy_input_category.py
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import time
from datetime import datetime, timedelta
from decimal import Decimal
from multiprocessing import Pool
File store_energy_input_item.py
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import time
from datetime import datetime, timedelta
from decimal import Decimal
from multiprocessing import Pool
Function run
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.run = function () {
var cf = function (e, conf) {
var k;
for (k in conf) {
s.o[k] = conf[k];
Function on_get
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_get(req, resp):
if 'API-KEY' not in req.headers or \
not isinstance(req.headers['API-KEY'], str) or \
len(str.strip(req.headers['API-KEY'])) == 0:
access_control(req)
File tenant_energy_input_category.py
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import time
from datetime import datetime, timedelta
from decimal import Decimal
from multiprocessing import Pool
File store_energy_input_category.py
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import time
from datetime import datetime, timedelta
from decimal import Decimal
from multiprocessing import Pool
Function ViewService
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ViewService = /** @class */ (function () {
/** @internal */
function ViewService(/** @internal */ router) {
var _this = this;
this.router = router;
Function editEnergyStorageContainerHVAC
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.editEnergyStorageContainerHVAC = function(energystoragecontainerhvac) {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerhvac.model.html',
controller: 'ModalEditEnergyStorageContainerHVACCtrl',
windowClass: "animated fadeIn",
Function name
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Resource[name] = function(a1, a2, a3, a4) {
var params = {}, data, onSuccess, onError;
switch (arguments.length) {
case 4:
Function addEnergyStorageContainerHVAC
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addEnergyStorageContainerHVAC = function() {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerhvac.model.html',
controller: 'ModalAddEnergyStorageContainerHVACCtrl',