Showing 124 of 139 total issues
Method getOptions
has 244 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static function getOptions()
{
return [
'options' => [
'any' => 'Any',
Method getOptions
has 243 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static function getOptions()
{
return [
'options' => [
'Afghanistan' => 'AF',
FieldConfigProcessor
has 65 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class FieldConfigProcessor
{
public $id;
public $name;
public $factory;
File FieldConfigProcessor.php
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Grafite\Forms\Services;
class FieldConfigProcessor
File Quill.php
has 453 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Grafite\Forms\Fields;
class Quill extends Field
Method js
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function js($id, $options)
{
return <<<JS
_formsjs_quillField = function (element) {
element.addEventListener('grafite-form-change', function (event) {
Method validHtmlAttributes
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validHtmlAttributes()
{
return [
'accept',
'accept-charset',
Method styles
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function styles($id, $options)
{
$darkTheme = '';
if (! isset($options['theme']) || (is_bool($options['theme']) && $options['theme'])) {
Method getOptions
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static function getOptions()
{
return [
'options' => [
'Pacific/Midway',
Method getOptions
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static function getOptions()
{
return [
'options' => [
'(UTC-11:00) Midway Island' => 'Pacific/Midway',
Method js
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function js($id, $options)
{
return <<<JS
_formsjs_autosuggestSelectField = function (inp) {
if (! inp.getAttribute('data-formsjs-rendered')) {
Method js
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function js($id, $options)
{
return <<<JS
_formsjs_tableActionBinding = function (element) {
let _id = element.getAttribute('name');
Form
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Form
{
use HasErrorBag;
/**
File Form.php
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Grafite\Forms\Forms;
use Illuminate\Support\Arr;
File FormMaker.php
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Grafite\Forms\Services;
use Illuminate\Support\Str;
File FieldMaker.php
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Grafite\Forms\Services;
use Illuminate\Support\Str;
File HtmlForm.php
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Grafite\Forms\Forms;
use Exception;
Method scripts
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function scripts()
{
return <<<JS
window.FormsJS_steps = function () {
let _steps = document.querySelectorAll('.form_step');
Method js
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function js($id, $options)
{
return <<<JS
_formsjs_bootstrapCustomSelectField = function (element) {
if (! element.getAttribute('data-formsjs-rendered')) {
Function makeSelect
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
public function makeSelect($name, $selected, $options)
{
$selectOptions = '';
if (isset($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"