swaggest/json-cli

View on GitHub

Showing 20 of 20 total issues

Function performAction has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    public function performAction()
    {
        $schema = new Schema();

        if ($this->schema) {
Severity: Minor
Found in src/BuildSchema.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 performAction has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function performAction()
    {
        $schema = new Schema();

        if ($this->schema) {
Severity: Major
Found in src/BuildSchema.php - About 3 hrs to fix

    Function performAction has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function performAction()
        {
            try {
                $skipRoot = false;
                $baseName = null;
    Severity: Minor
    Found in src/GenPhp.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 performAction has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        public function performAction()
        {
            try {
                $skipRoot = false;
                $baseName = null;
    Severity: Minor
    Found in src/GenGo.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

    Method performAction has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function performAction()
        {
            try {
                $skipRoot = false;
                $baseName = null;
    Severity: Major
    Found in src/GenPhp.php - About 2 hrs to fix

      Method performAction has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function performAction()
          {
              try {
                  $skipRoot = false;
                  $baseName = null;
      Severity: Major
      Found in src/GenGo.php - About 2 hrs to fix

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

            protected function loadSchema(&$skipRoot, &$baseName)
            {
                if ($this->schema === '-') {
                    $this->schema = 'php://stdin';
                }
        Severity: Minor
        Found in src/Base.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 loadSchema has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function loadSchema(&$skipRoot, &$baseName)
            {
                if ($this->schema === '-') {
                    $this->schema = 'php://stdin';
                }
        Severity: Minor
        Found in src/Base.php - About 1 hr to fix

          Method performAction has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function performAction()
              {
                  $listener = new FilePosition\PositionResolver();
                  $stream = fopen($this->path, 'r');
                  if ($stream === false) {
          Severity: Minor
          Found in src/ResolvePos.php - About 1 hr to fix

            Function loadFile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function loadFile()
                {
                    $dataValue = Base::readJsonOrYaml($this->schema, $this->response);
                    if (!$dataValue) {
                        throw new ExitCode('Unable to find schema in ' . $this->schema, 1);
            Severity: Minor
            Found in src/Json/LoadFile.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 performAction has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function performAction()
                {
                    $listener = new FilePosition\PositionResolver();
                    $stream = fopen($this->path, 'r');
                    if ($stream === false) {
            Severity: Minor
            Found in src/ResolvePos.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 makeGoBuilderOptions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function makeGoBuilderOptions()
                {
                    $options = new Options();
                    if (!empty($this->config)) {
                        $data = file_get_contents($this->config);
            Severity: Minor
            Found in src/GenGo/BuilderOptions.php - About 1 hr to fix

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

                  public static function setUpBuilderOptions($options)
                  {
                      $options->showConstProperties = Option::create()
                          ->setDescription('Show properties with constant values, hidden by default');
              
              
              Severity: Minor
              Found in src/GenGo/BuilderOptions.php - About 1 hr to fix

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

                    public function performAction()
                    {
                        try {
                            $skipRoot = false;
                            $baseName = null;
                Severity: Minor
                Found in src/GenMarkdown.php - About 1 hr to fix

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

                      public function performAction()
                      {
                          $this->prePerform();
                          if (null === $this->diff) {
                              return;
                  Severity: Minor
                  Found in src/Diff.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 makeGoBuilderOptions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function makeGoBuilderOptions()
                      {
                          $options = new Options();
                          if (!empty($this->config)) {
                              $data = file_get_contents($this->config);
                  Severity: Minor
                  Found in src/GenGo/BuilderOptions.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 performAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function performAction()
                      {
                          try {
                              $skipRoot = false;
                              $baseName = null;
                  Severity: Minor
                  Found in src/GenMarkdown.php - About 35 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 performAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function performAction()
                      {
                          if ($this->schema) {
                              $schemaData = $this->readData($this->schema);
                              try {
                  Severity: Minor
                  Found in src/ValidateSchema.php - About 35 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 postPerform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function postPerform()
                      {
                          $options = JSON_UNESCAPED_SLASHES + JSON_UNESCAPED_UNICODE;
                          if ($this->pretty) {
                              $options += JSON_PRETTY_PRINT;
                  Severity: Minor
                  Found in src/Base.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 performAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function performAction()
                      {
                          try {
                              $skipRoot = false;
                              $baseName = null;
                  Severity: Minor
                  Found in src/GenJSDoc.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