dothiv/dothiv

View on GitHub

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+/, '')

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];

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();
Severity: Minor
Found in src/Dothiv/CharityWebsiteBundle/Controller/BrowserPluginController.php - About 25 mins to fix

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) {

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)));
Severity: Minor
Found in src/Dothiv/APIBundle/Controller/CRUDController.php - About 25 mins to fix

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) {
Severity: Minor
Found in src/Dothiv/BusinessBundle/Report/DomainReporter.php - About 25 mins to fix

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) {
Severity: Minor
Found in src/Dothiv/BusinessBundle/Report/ClicksReporter.php - About 25 mins to fix

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');
Severity: Minor
Found in src/Dothiv/APIBundle/JsonLd/Client/JsonLdGuzzleClient.php - About 25 mins to fix

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())) {
Severity: Minor
Found in src/Dothiv/ContentfulBundle/Listener/SyncContentType.php - About 25 mins to fix

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')) {
Severity: Minor
Found in src/Dothiv/APIBundle/Controller/UserController.php - About 25 mins to fix

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();
Severity: Minor
Found in src/Dothiv/APIBundle/Security/Firewall/Oauth2BearerListener.php - About 25 mins to fix

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;

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

Severity
Category
Status
Source
Language