robotomize/fujes

View on GitHub

Showing 26 of 145 total issues

SearchEngine has 39 functions (exceeds 20 allowed). Consider refactoring.
Open

class SearchEngine
{
    /**
     * @var string
     */
Severity: Minor
Found in src/robotomize/Fujes/SearchEngine.php - About 5 hrs to fix

    File SearchEngine.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
        /**
         * This file is part of the Fujes package.
         * @link    https://github.com/robotomize/fujes
         * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
    Severity: Minor
    Found in src/robotomize/Fujes/SearchEngine.php - About 4 hrs to fix

      Method testCities has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testCities()
          {
              $this->assertEquals('Vladivostok', SearchFactory::find(
                  self::$prefix . self::$testUrlName[0],
                  self::$testMatchString[0],
      Severity: Major
      Found in tests/FactoryTest.php - About 4 hrs to fix

        SearchLevenshteinCompare has 33 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class SearchLevenshteinCompare implements ISearch
        {
            /**
             * @var array
             */
        Severity: Minor
        Found in src/robotomize/Fujes/SearchLevenshteinCompare.php - About 4 hrs to fix

          SearchSubstringCompare has 30 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class SearchSubstringCompare implements ISearch
          {
              /**
               * @var array
               */
          Severity: Minor
          Found in src/robotomize/Fujes/SearchSubstringCompare.php - About 3 hrs to fix

            Method testParseJson has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function testParseJson()
                {
                    $searchEngine = new SearchEngine(
                        self::$prefix . self::$testUrlName[0],
                        self::$testMatchString[0],
            Severity: Major
            Found in tests/SearchEngineTest.php - About 2 hrs to fix

              File SearchLevenshteinCompare.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
                  /**
                   * This file is part of the Fujes package.
                   * @link    https://github.com/robotomize/fujes
                   * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
              Severity: Minor
              Found in src/robotomize/Fujes/SearchLevenshteinCompare.php - About 2 hrs to fix

                SearchFacade has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class SearchFacade
                {
                
                    /**
                     * @var string
                Severity: Minor
                Found in src/robotomize/Fujes/SearchFacade.php - About 2 hrs to fix

                  Function search has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function search($inputArray = [], $key = '', $level = 0)
                      {
                          if (0 === count($inputArray)) {
                              $inputArray = $this->inputArray;
                          }
                  Severity: Minor
                  Found in src/robotomize/Fujes/SearchLevenshteinCompare.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 __construct has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function __construct(
                          $urlName,
                          $matchString,
                          $depth = 1,
                          $jsonEncode = true,
                  Severity: Minor
                  Found in src/robotomize/Fujes/SearchEngine.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 preSearch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function preSearch($inputArray = [], $key = '', $level = 0)
                      {
                          if (0 === count($inputArray)) {
                              $inputArray = $this->inputArray;
                          }
                  Severity: Minor
                  Found in src/robotomize/Fujes/SearchLevenshteinCompare.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 preSearch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function preSearch($inputArray = [], $key = '', $level = 0)
                      {
                          if (0 === count($inputArray)) {
                              $inputArray = $this->inputArray;
                          }
                  Severity: Minor
                  Found in src/robotomize/Fujes/SearchSubstringCompare.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 substringIterator has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function substringIterator($currentString)
                      {
                          $currentIterationCount = 0;
                          $currentMaxStackValue = 0;
                  
                  
                  Severity: Minor
                  Found in src/robotomize/Fujes/SearchSubstringCompare.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 search has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function search($inputArray = [], $key = '', $level = 0)
                      {
                          if (0 === count($inputArray)) {
                              $inputArray = $this->inputArray;
                          }
                  Severity: Minor
                  Found in src/robotomize/Fujes/SearchSubstringCompare.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 run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function run()
                      {
                          $this->parseJsonToArray();
                          if (0 === count($this->jsonTree)) {
                              $this->exceptionObject->create('The data is not in JSON format');
                  Severity: Minor
                  Found in src/robotomize/Fujes/SearchEngine.php - About 1 hr to fix

                    Method __construct has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function __construct(
                            $urlName,
                            $matchString,
                            $depth = 1,
                            $jsonEncode = true,
                    Severity: Minor
                    Found in src/robotomize/Fujes/SearchEngine.php - About 1 hr to fix

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

                          public function run()
                          {
                              $this->parseJsonToArray();
                              if (0 === count($this->jsonTree)) {
                                  $this->exceptionObject->create('The data is not in JSON format');
                      Severity: Minor
                      Found in src/robotomize/Fujes/SearchEngine.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 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              $urlName,
                              $matchString,
                              $depth = 1,
                              $jsonEncode = true,
                              $multipleResult = false,
                      Severity: Major
                      Found in src/robotomize/Fujes/SearchEngine.php - About 50 mins to fix

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

                                $urlName,
                                $matchString,
                                $depth = 1,
                                $jsonEncode = true,
                                $multipleResult = false,
                        Severity: Major
                        Found in src/robotomize/Fujes/SearchFactory.php - About 50 mins to fix

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

                                  $urlName,
                                  $matchString,
                                  $depth = 1,
                                  $jsonEncode = true,
                                  $multipleResult = false,
                          Severity: Major
                          Found in src/robotomize/Fujes/SearchFacade.php - About 50 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language