meysampg/espricho

View on GitHub

Showing 26 of 816 total issues

Function createSection has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private function createSection(string $name, array $data, $makeNested = true): array
    {
        $query = [];

        if (method_exists($this, $name)) {
Severity: Minor
Found in Components/ElasticSearch/YamlConfigSearchCondition.php - About 3 hrs 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 populatePlaceHoldersWithData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private function populatePlaceHoldersWithData(array $query, array $data): array
    {
        $newQuery = [];

        foreach ($query as $term => $value) {
Severity: Minor
Found in Components/ElasticSearch/YamlConfigSearchCondition.php - About 2 hrs 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

Bootstraper has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Bootstraper
{
    /**
     * The system instance
     *
Severity: Minor
Found in Components/Application/Bootstraper.php - About 2 hrs to fix

    Method execute has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            if (!$input->getOption('username') && !$input->getOption('id')) {
                $output->writeln('One of <info>id</info> or <info>username</info> options are required.');
    
    
    Severity: Minor
    Found in Components/Auth/Commands/AdminUserCommand.php - About 1 hr to fix

      Method createSection has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function createSection(string $name, array $data, $makeNested = true): array
          {
              $query = [];
      
              if (method_exists($this, $name)) {
      Severity: Minor
      Found in Components/ElasticSearch/YamlConfigSearchCondition.php - About 1 hr to fix

        Function execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                if (!$input->getOption('username') && !$input->getOption('id')) {
                    $output->writeln('One of <info>id</info> or <info>username</info> options are required.');
        
        
        Severity: Minor
        Found in Components/Auth/Commands/AdminUserCommand.php - About 1 hr 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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $mappings = $this->getMappings($input, $output, sys()->getConfig('elasticsearch.mappings'));
        
                foreach ($mappings as $index => $mapping) {
        Severity: Minor
        Found in Components/ElasticSearch/Commands/CreateESMappingCommand.php - About 1 hr 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

        Method populatePlaceHoldersWithData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function populatePlaceHoldersWithData(array $query, array $data): array
            {
                $newQuery = [];
        
                foreach ($query as $term => $value) {
        Severity: Minor
        Found in Components/ElasticSearch/YamlConfigSearchCondition.php - About 1 hr to fix

          Method configure has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function configure()
              {
                  $this->setName('auth:admin-user')
                       ->setDescription('Make or remove a user from admin role')
                       ->addOption(
          Severity: Minor
          Found in Components/Auth/Commands/AdminUserCommand.php - About 1 hr to fix

            Method getConfigurationOptions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function getConfigurationOptions(System $system): array
                {
                    return [
                         'auto_eject_hosts'       => $system->getConfig('auto_eject_hosts', false),
                         'buffer_writes'          => $system->getConfig('buffer_writes', false),
            Severity: Minor
            Found in Components/Memcached/Providers/MemcachedProvider.php - About 1 hr to fix

              Method getMappings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getMappings(InputInterface $input, OutputInterface $output, array $configMappings): array
                  {
                      $mappings = [];
              
                      if ($input->getOption('index')) {
              Severity: Minor
              Found in Components/ElasticSearch/Commands/CreateESMappingCommand.php - About 1 hr to fix

                Method fire has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function fire()
                    {
                        // TODO: use event listener on exceptions
                        try {
                            $request = Request::createFromGlobals();
                Severity: Minor
                Found in Components/Http/HttpKernel.php - About 1 hr to fix

                  Method configure has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function configure()
                      {
                          $this->setName('auth:create-user')
                               ->setDescription('Create a new user')
                               ->addArgument(
                  Severity: Minor
                  Found in Components/Auth/Commands/CreateUserCommand.php - About 1 hr to fix

                    Function runMiddleware has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Confirmed

                        public function runMiddleware(RouteResolvedEvent $event)
                        {
                            $route       = $event->getRoute();
                            $middlewares = (array)$route->getDefault('middleware');
                            $toRun       = [];
                    Severity: Minor
                    Found in Components/Routes/Subscribers/UrlMatchedMiddlewareSubscriber.php - About 55 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 match has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function match(array $query, string $from = 'must', $makeNested = true): array
                        {
                            $newQuery = [];
                    
                            foreach ($query as $term => $value) {
                    Severity: Minor
                    Found in Components/ElasticSearch/YamlConfigSearchCondition.php - About 55 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 getSearchData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function getSearchData($data, string $prefix = ''): array
                        {
                            $newData = [];
                    
                            foreach ($data as $key => $value) {
                    Severity: Minor
                    Found in Components/ElasticSearch/Searcher.php - About 55 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 getMappings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function getMappings(InputInterface $input, OutputInterface $output, array $configMappings): array
                        {
                            $mappings = [];
                    
                            if ($input->getOption('index')) {
                    Severity: Minor
                    Found in Components/ElasticSearch/Commands/CreateESMappingCommand.php - About 55 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 generateNestedMapping has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function generateNestedMapping(array $mapping, bool $nestedCall = false): array
                        {
                            $final = [];
                    
                            foreach ($mapping as $item => $value) {
                    Severity: Minor
                    Found in Components/ElasticSearch/Commands/CreateESMappingCommand.php - About 45 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

                    Method loadModuleRoutes has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Confirmed

                             RouteCollection $routes,
                             array $module,
                             string $name,
                             ?string $dir = null,
                             ?string $file = null
                    Severity: Minor
                    Found in Components/Routes/RoutesLoader.php - About 35 mins to fix

                      Method makeNested has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          private function makeNested(string $field, string $term, string $wrapper, $data, bool $negate = true): array
                      Severity: Minor
                      Found in Components/ElasticSearch/YamlConfigSearchCondition.php - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language