Showing 1,912 of 1,912 total issues
Function tokenizer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
lunr.tokenizer = function (obj) {
if (!arguments.length || obj == null || obj == undefined) return []
if (Array.isArray(obj)) return obj.map(function (t) { return t.toLowerCase() })
var str = obj.toString().replace(/^\s+/, '')
- 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 templateMerge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
service.templateMerge = ['reindentCode', function(indentCode) {
return function(template, properties) {
return template.replace(/\{\{(\w+)(?:\:(\d+))?\}\}/g, function(_, key, indent) {
var value = properties[key];
- 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 redirectsAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function redirectsAction(Request $request, $locale)
{
$response = $this->createResponse();
$lmc = $this->getLastModifiedCache();
- 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 getCountRegistrations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getCountRegistrations($filter)
{
$date = null;
$count = 0;
foreach ($this->nonProfitRegistrationRepo->findAll() as $registration) {
- 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 checkPermission
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function checkPermission(EntityInterface $item)
{
if ($this->isUserController() || !$this->isAdmin()) {
if (!($item instanceof OwnerEntityInterface)) {
throw new AccessDeniedHttpException(sprintf('"%s" items have no owner!', $this->itemRepo->getItemEntityName($item)));
- 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 getDomains
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getDomains($filter)
{
$date = null;
$count = 0;
foreach ($this->domainRepo->findAll() as $domain) {
- 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 getLiveDomains
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getLiveDomains()
{
$date = null;
$count = 0;
foreach ($this->domainRepo->findAll() as $domain) {
- 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 getListResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getListResponse(URLValue $url, $itemClass)
{
$response = $this->get($url);
$data = $this->getData($response);
$this->expectProperty($data, '@context', 'http://jsonld.click4life.hiv/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 onContentTypesSync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onContentTypesSync(ContentfulContentTypesEvent $event)
{
$contentTypesToSpaceId = new ArrayCollection();
foreach ($event->getContentTypes() as $contentType) {
if (!$contentTypesToSpaceId->containsKey($contentType->getSpaceId())) {
- 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 updateProfileAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateProfileAction(Request $request, $handle)
{
$user = $this->verifyUserHandle($handle);
$data = json_decode($request->getContent());
if (property_exists($data, 'email')) {
- 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 handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function handle(GetResponseEvent $event)
{
$request = $event->getRequest();
$token = new Oauth2BearerToken();
- 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 onViewCreate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onViewCreate(ContentfulViewEvent $event)
{
$view = $event->getView();
if ($view->cfMeta['contentType'] != $this->contentType) return;
$field = $this->field;
- 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"