Sleepness/UberTranslationBundle

View on GitHub

Showing 5 of 5 total issues

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

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();
        $locales = $container->getParameter('sleepness_uber_translation.supported_locales'); // prepare locales from parameters
        $bundle = $container->get('kernel')->getBundle($input->getArgument('bundle')); // get bundle props
Severity: Minor
Found in Command/ImportCommand.php - About 6 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 execute has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();
        $bundleName = $input->getArgument('bundle');
        $bundlePath = $container->get('kernel')->getBundle($bundleName)->getPath();
Severity: Minor
Found in Command/ExportCommand.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

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

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();
        $locales = $container->getParameter('sleepness_uber_translation.supported_locales'); // prepare locales from parameters
        $bundle = $container->get('kernel')->getBundle($input->getArgument('bundle')); // get bundle props
Severity: Minor
Found in Command/ImportCommand.php - About 1 hr to fix

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

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $container = $this->getContainer();
            $bundleName = $input->getArgument('bundle');
            $bundlePath = $container->get('kernel')->getBundle($bundleName)->getPath();
    Severity: Minor
    Found in Command/ExportCommand.php - About 1 hr to fix

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

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $uberMemcached = $this->getContainer()->get('uber.memcached'); // get uber memcached
              $memcachedKeys = $uberMemcached->getAllKeys();
              $output->writeln("\033[37;43m Translations from memcache: \033[0m");
      Severity: Minor
      Found in Command/DumpCommand.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

      Severity
      Category
      Status
      Source
      Language