File HtmlForm.php
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Grafite\Forms\Forms;
use Exception;
HtmlForm
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class HtmlForm extends Form
{
/**
* Simple wrapper for cards
*
Function formButtonsAndClose
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function formButtonsAndClose()
{
$rowAlignment = config('forms.form.sections.row-alignment-end', 'd-flex justify-content-end');
if (isset($this->buttons['cancel']) || $this->columns === 'steps' || $this->buttonsJustified) {
- Read upRead up
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 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
parent::__construct();
$this->url = app(UrlGenerator::class);
Method formButtonsAndClose
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formButtonsAndClose()
{
$rowAlignment = config('forms.form.sections.row-alignment-end', 'd-flex justify-content-end');
if (isset($this->buttons['cancel']) || $this->columns === 'steps' || $this->buttonsJustified) {
Method formSubmitHtml
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formSubmitHtml()
{
$html = '';
$onSubmit = null;
Function parseFields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function parseFields($formFields)
{
$fields = [];
if (empty($formFields)) {
- Read upRead up
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 formSubmitHtml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function formSubmitHtml()
{
$html = '';
$onSubmit = null;
- Read upRead up
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"