Showing 124 of 139 total issues
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$route,
$method = 'post',
$content = '',
$message = '',
$payload = [],
Function _formsjs_set_bindings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
window._formsjs_set_bindings = function () {
document.querySelectorAll('[data-formsjs-onload]').forEach(function (element) {
if (! element.hasAttribute('data-formsjs-rendered')) {
let _method = element.getAttribute('data-formsjs-onload');
window[_method](element);
Function getOptionSelectedValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getOptionSelectedValue($selected, $value, $options)
{
$selectedValue = '';
if (
- 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 render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function render($attributes, $name = null, $livewireEnabled = false, $livewireOnKeydown = false, $livewireOnChange = false)
{
$html = [];
$livewireAttributes = [];
- 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 boot
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
$this->publishes([
__DIR__ . '/../config/forms.php' => base_path('config/forms.php'),
]);
Function FormsJS_validation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.FormsJS_validation = function () {
let _fields = document.getElementsByClassName('_formValidationClass');
for (let i = 0; i < _fields.length; i++) {
_fields[i].addEventListener("keyup", function (e) {
Method js
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function js($id, $options)
{
return <<<JS
_formsjs_datetimePickerField = function (element) {
if (! element.getAttribute('data-formsjs-rendered')) {
Method styles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function styles($id, $options)
{
return <<<CSS
.form-autocomplete {
position: relative;
Method styles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function styles($id, $options)
{
return <<<CSS
.form-autocomplete {
position: relative;
Function getFieldsAsInputs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getFieldsAsInputs($fields, $formBuild)
{
$inputs = [];
foreach ($fields as $field) {
- 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 makeRelationship
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function makeRelationship($name, $value, $options)
{
$method = 'all';
$class = $options['model'];
- 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 getObjectValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getObjectValue($object, $name)
{
if (is_object($object) && isset($object->$name)) {
return $object->$name;
}
- 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 edit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function edit($model = null)
{
if (! is_null($model)) {
$this->setInstance($model);
}
- 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 getWrappers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function getWrappers($options, $key)
{
$groupTextClass = config('forms.form.input-group-text', 'input-group-text');
if (isset($options[$key])) {
- 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 action
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function action($method, $route, $button = 'Send', $options = [], $asModal = false, $disableOnSubmit = false, $submitViaAjax = false)
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 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 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 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
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"