marcusgsta/comment

View on GitHub

Showing 7 of 11 total issues

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

    public function __construct(DIInterface $di, $acronym)
    {
        parent::__construct($di);

        $user = new User();
Severity: Minor
Found in src/User/HTMLForm/EditUserForm.php - About 1 hr to fix

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

        public function __construct(DIInterface $di)
        {
            parent::__construct($di);
    
            $editable = "hidden";
    Severity: Minor
    Found in src/User/HTMLForm/CreateUserForm.php - About 1 hr to fix

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

          public function __construct(DIInterface $di, $data)
          {
              parent::__construct($di);
      
              $comment = new Comment();
      Severity: Minor
      Found in src/Comment/HTMLForm/EditCommentForm.php - About 1 hr to fix

        Method renderPage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function renderPage($data, $status = 200)
            {
                $data["stylesheets"] = ["css/bootstrap.min.css", "css/style.css", "css/remserver.css"];
                $data["javascripts"] = [
                    "js/jquery-3.2.1.slim.min.js",
        Severity: Minor
        Found in src/Page/PageRender.php - About 1 hr to fix

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

              public function getHtml()
              {
                  $items = $this->config;
          
                  $page = basename($_SERVER['REQUEST_URI']);
          Severity: Minor
          Found in src/Navbar/Navbar.php - About 1 hr to fix

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

                public function __construct(DIInterface $di)
                {
                    parent::__construct($di);
                    $page = $this->di->session->get("previous");
                    $acronym = $this->di->session->get("user");
            Severity: Minor
            Found in src/Comment/HTMLForm/CreateCommentForm.php - About 1 hr to fix

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

                  public function getHtml()
                  {
                      $items = $this->config;
              
                      $page = basename($_SERVER['REQUEST_URI']);
              Severity: Minor
              Found in src/Navbar/Navbar.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