taviroquai/duality

View on GitHub

Showing 38 of 38 total issues

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

    public function execute(Request &$request)
    {
        $this->init();
        $header = array();
        $reqHeaders = $request->getHeaders(); 
Severity: Minor
Found in src/Duality/Service/Client.php - About 1 hr to fix

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

        public function updateFromConfig()
        {
            // Begin transation
            $this->pdo->beginTransaction();
    
    
    Severity: Minor
    Found in src/Duality/Service/Database.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 connect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function connect($host, $username, $password = '', $port = 22)
        {
            // Start connection
            if (!($this->connection = @ssh2_connect($host, $port))) {
                throw new DualityException(
    Severity: Minor
    Found in src/Duality/Service/SSH.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

    Method getSelect has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0
    Severity: Minor
    Found in src/Duality/Service/Database/MySql.php - About 45 mins to fix

      Method setSMTP has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $host, $user = '', $pass = '', $encr = 'tls', $port = 587, $debugLevel = 0
      Severity: Minor
      Found in src/Duality/Service/Mailer.php - About 45 mins to fix

        Method connectSSH has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $host,
                $username,
                $password = '',
                $port = 22,
                $paraphrase = null,
        Severity: Minor
        Found in src/Duality/Service/SSH.php - About 45 mins to fix

          Method getSelect has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0
          Severity: Minor
          Found in src/Duality/Service/Database/SQLite.php - About 45 mins to fix

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

                public function send(\Closure $callback)
                {
                    $mail = new PHPMailer;
            
                    // Setup SMTP
            Severity: Minor
            Found in src/Duality/Service/Mailer.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

            Method getSelect has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0
            Severity: Minor
            Found in src/Duality/Service/Database.php - About 45 mins to fix

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

                      $key, $value, $filters, $pass = '', $fail = ''
              Severity: Minor
              Found in src/Duality/Structure/RuleItem.php - About 35 mins to fix

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

                        $offset = 0, $limit = 10, $where = '', $values = array(), $select = '*'
                Severity: Minor
                Found in src/Duality/Structure/Database/Table.php - About 35 mins to fix

                  Function listen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function listen()
                      {
                          $notfound = true;
                          foreach ($this->responders as $ns => $cb) {
                              foreach ($this->argv as $item) {
                  Severity: Minor
                  Found in src/Duality/Service/Commander.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 load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function load(\Closure $callback = null)
                      {
                          if (is_resource($this->handler) && filesize($this->getPath()) > 0) {
                              rewind($this->handler);
                              $length = filesize($this->getPath()) < 4096 ? 
                  Severity: Minor
                  Found in src/Duality/Structure/File/StreamFile.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 reloadFromConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function reloadFromConfig($config)
                      {
                          $this->schema = $config;
                          if (!isset($this->schema['create'])) {
                              $this->schema['create'] = array();
                  Severity: Minor
                  Found in src/Duality/Service/Database.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 encrypt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function encrypt($data)
                      {
                          // Set defaults
                          $algo = 'sha256';
                          $salt = '';
                  Severity: Minor
                  Found in src/Duality/Service/Security.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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function init()
                      {
                          if (!extension_loaded('intl')) {
                              throw new DualityException(
                                  "Error: intl extension not loaded",
                  Severity: Minor
                  Found in src/Duality/Service/Localization.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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function __construct(Database $db)
                      {
                          $this->properties = new Storage;
                          if (!empty($this->config['name'])) {
                              $this->setName($this->config['name']);
                  Severity: Minor
                  Found in src/Duality/Structure/Entity.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 importArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function importArray($data)
                      {
                          foreach ($data as $key => $item) {
                              $row = new TableRow($this);
                              foreach ($this->getColumns() as $col => $prop) {
                  Severity: Minor
                  Found in src/Duality/Structure/Table.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