DeploymentTools/MySQL-to-object-mapper

View on GitHub

Showing 22 of 26 total issues

Function extractElementFragments has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    protected function extractElementFragments()
    {
        $elements = array();
        $currentCursor = 0;

Severity: Minor
Found in app/Extractor/Fields.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 extractElementFragments has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    protected function extractElementFragments()
    {
        $tablesRaw = array();
        $tablesRawCursor = 0;
        $this->previousChar = null;
Severity: Minor
Found in app/Extractor/Tables.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 appendDifferencesTables has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function appendDifferencesTables($table1, $table2)
    {
        $matchedFields = [];
        $differences = [
            'field-diffs' => [],
Severity: Minor
Found in app/Console/Command/SnapshotCompareCommand.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

Function appendDifferencesDatabases has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function appendDifferencesDatabases($db1, $db2)
    {
        $matchedTables = [];

        $databaseDiffs = [
Severity: Minor
Found in app/Console/Command/SnapshotCompareCommand.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 getFirstChunk has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getFirstChunk($string)
    {
        $firstChar = substr($string, 0, 1);
        $secondChar = substr($string, 1, 1);

Severity: Minor
Found in app/Extractor/String.php - About 1 hr to fix

    Function getFirstChunk has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getFirstChunk($string)
        {
            $firstChar = substr($string, 0, 1);
            $secondChar = substr($string, 1, 1);
    
    
    Severity: Minor
    Found in app/Extractor/String.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 execute has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $notFound = false;
            $source = $input->getArgument('source');
            $destination = $input->getArgument('destination');
    Severity: Minor
    Found in app/Console/Command/SyncCompareCommand.php - About 1 hr to fix

      Method extractElementFragments has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function extractElementFragments()
          {
              $elements = array();
              $currentCursor = 0;
      
      
      Severity: Minor
      Found in app/Extractor/Fields.php - About 1 hr to fix

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

            public function execute($databaseName = '')
            {
                $this->prepareSourceEntries();
        
                if ($this->entries->count() > 0) {
        Severity: Minor
        Found in app/Driver/Disk.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 appendDifferencesTables has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected static function appendDifferencesTables($table1, $table2)
            {
                $matchedFields = [];
                $differences = [
                    'field-diffs' => [],
        Severity: Minor
        Found in app/Console/Command/SnapshotCompareCommand.php - About 1 hr to fix

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

              protected function extractElementFragments()
              {
                  $tablesRaw = array();
                  $tablesRawCursor = 0;
                  $this->previousChar = null;
          Severity: Minor
          Found in app/Extractor/Tables.php - About 1 hr to fix

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

                public static function appendDifferencesDatabases($db1, $db2)
                {
                    $matchedTables = [];
            
                    $databaseDiffs = [
            Severity: Minor
            Found in app/Console/Command/SnapshotCompareCommand.php - About 1 hr to fix

              Function getKeyFromString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getKeyFromString($fieldString)
                  {
                      $pattern = self::$patterns['key'];
                      preg_match($pattern, $fieldString, $matches);
                      if ($matches) {
              Severity: Minor
              Found in app/Extractor/Fields.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 checkQuotes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function checkQuotes()
                  {
                      if (!$this->inComment() && ($this->previousChar != '\\')) {
                          if ($this->currentChar == "'") {
                              $this->inSingleQuote = !$this->inSingleQuote;
              Severity: Minor
              Found in app/Extractor/Tables.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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output)
                  {
                      $notFound = false;
                      $source = $input->getArgument('source');
                      $outputPath = $input->getArgument('output');
              Severity: Minor
              Found in app/Console/Command/SnapshotCreateCommand.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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output)
                  {
                      $notFound = false;
                      $source = $input->getArgument('source');
                      $destination = $input->getArgument('destination');
              Severity: Minor
              Found in app/Console/Command/SyncCompareCommand.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 checkInComment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function checkInComment()
                  {
                      if (!$this->inQuote()) {
                          if ($this->inMultiLineComment && ($this->currentChar == '/') && ($this->previousChar == '*')) {
                              $this->inMultiLineComment = false;
              Severity: Minor
              Found in app/Extractor/Tables.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

              Avoid too many return statements within this method.
              Open

                                      return ($firstChar === '-') ? '-' . $result : $result;
              Severity: Major
              Found in app/Extractor/String.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return $buildString;
                Severity: Major
                Found in app/Extractor/String.php - About 30 mins to fix

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

                      protected static function appendDifferencesFields($field1, $field2)
                      {
                          $differences = [];
                  
                          if ($field1 !== $field2) {
                  Severity: Minor
                  Found in app/Console/Command/SnapshotCompareCommand.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