Showing 47 of 63 total issues
Function buildColumnForm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function buildColumnForm($formBuild, $columns, $isStepped = false)
{
$formSections = [];
if (! empty($this->sections)) {
- 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 buildSection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function buildSection($fields, $columns, $label = null)
{
$formChunks = [];
$newFormBuild = [];
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function create()
{
$this->submitMethod = $this->submitMethods['create'] ?? null;
if ($this->orientation === 'horizontal') {
- 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 styles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function styles()
{
$color = $this->progressBarColor ?? '#28a745';
$numberOfSteps = count($this->steps($this->fieldsForSteps));
$size = $numberOfSteps * 100;
- 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 handler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handler($content)
{
$convertor = new HtmlConvertor([
'raw' => function ($html) {
return $html;
- 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 makeField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function makeField($columnConfig, $label, $column, $value, $errors)
Method render
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function render($attributes, $name = null, $livewireEnabled = false, $livewireOnKeydown = false, $livewireOnChange = false)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$index,
$route,
$content = "",
$placeholder = "",
$method = "post"
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$form,
$item,
$confirm = false,
$confirmMessage = "Are you sure you want to delete this item?",
$confirmMethod = "confirm"
Function make
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function make()
{
if ($this->orientation === 'horizontal') {
$this->formClass = $this->formClass ?? config('forms.form.horizontal-class', 'form-horizontal');
}
- 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"
Further reading
Function isChecked
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function isChecked($name, $value, $options)
{
if (is_null($value) && isset($options['attributes']['value'])) {
$value = $options['attributes']['value'];
}
- 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 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
Avoid too many return
statements within this method. Open
return "<img src=\"{$file['url']}\" title=\"{$caption}\" alt=\"{$caption}\">";
Avoid too many return
statements within this method. Open
return "<pre><code>{$code}</code></pre>";
Avoid too many return
statements within this method. Open
return $this->buildColumnForm($formBuild, null);
Avoid too many return
statements within this method. Open
return "<table>{$contents}</table>";
Avoid too many return
statements within this method. Open
return $this->buildColumnForm($formBuild, 6);
Avoid too many return
statements within this method. Open
return "<figure><blockquote style=\"text-align: {$alignment};\">{$text}</blockquote><figcaption>{$caption}</figcaption></figure>";
Avoid too many return
statements within this method. Open
return "<{$listStyle}l>{$listItems}</{$listStyle}l>";