sysPass/syspass-decrypter

View on GitHub

Showing 9 of 9 total issues

Function getNodes has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNodes(DOMNodeList $nodeList, string $password = null): array
    {
        $xpath = $this->xmlParser->getXpath();

        $clients = NodeAdapter::arrayAdapter(
Severity: Minor
Found in lib/SPDecrypter/Services/XmlSearch/SearchAdapter.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

Method getNodes has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getNodes(DOMNodeList $nodeList, string $password = null): array
    {
        $xpath = $this->xmlParser->getXpath();

        $clients = NodeAdapter::arrayAdapter(
Severity: Major
Found in lib/SPDecrypter/Services/XmlSearch/SearchAdapter.php - About 2 hrs to fix

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

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            try {
                $password = $input->getOption('password');
    
    
    Severity: Major
    Found in lib/SPDecrypter/Commands/SearchAccountCommand.php - About 2 hrs to fix

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

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              try {
                  $password = $input->getOption('password');
      
      
      Severity: Minor
      Found in lib/SPDecrypter/Commands/SearchAccountCommand.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 __construct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct(CLImate $climate, LoggerInterface $logger, SymfonyStyle $io)
          {
              parent::__construct();
      
              $this->climate = $climate;
      Severity: Minor
      Found in lib/SPDecrypter/Commands/CommandBase.php - About 1 hr to fix

        Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function __construct(CLImate $climate,
                                        LoggerInterface $logger,
                                        SymfonyStyle $io,
                                        XmlParser $xmlParser,
                                        XmlReader $xmlReader,
        Severity: Major
        Found in lib/SPDecrypter/Commands/SearchAccountCommand.php - About 50 mins to fix

          Function normalizeVersionForCompare has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function normalizeVersionForCompare($versionIn): string
              {
                  if (!empty($versionIn)) {
                      if (is_string($versionIn)) {
                          list($version, $build) = explode('.', $versionIn);
          Severity: Minor
          Found in lib/SPDecrypter/Util/Version.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

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

              public static function checkVersion($first, $second)
              {
                  $first = self::normalizeVersionForCompare($first);
                  $second = self::normalizeVersionForCompare($second);
          
          
          Severity: Minor
          Found in lib/SPDecrypter/Util/Version.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 decrypt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function decrypt($data, $securedKey, $password = null)
              {
                  try {
                      if ($securedKey instanceof Key) {
                          return Crypto::decrypt($data, $securedKey);
          Severity: Minor
          Found in lib/SPDecrypter/Util/Crypt.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