Showing 25 of 25 total issues
FieldConfig
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class FieldConfig
{
/**
* Field name.
*
ExcelExport
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class ExcelExport extends RenderableComponent
{
const NAME = 'excel_export';
const INPUT_PARAM = 'xls';
const DEFAULT_ROWS_LIMIT = 5000;
Function apply
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function apply()
{
$input = $this->grid->getInputProcessor()->getInput();
$sort = null;
if (isset($input['sort'])) {
- 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 getDefaultJsOptions
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getDefaultJsOptions()
{
$carbon = new Carbon();
$prev_month = Carbon::now()->startOfMonth()->subWeek();
$today = Carbon::now();
Method makeConfigBlueprint
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function makeConfigBlueprint()
{
$component_blueprint = $this->blueprints->getFor(self::COMPONENT_CLASS);
if (!$component_blueprint) {
throw new LogicException(
Method listen
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function listen(DataProvider $provider)
{
Event::listen(
DataProvider::EVENT_FETCH_ROW,
function (DataRow $row, DataProvider $currentProvider) use ($provider) {
Method makeComponentBlueprint
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function makeComponentBlueprint()
{
$blueprint = new Blueprint(self::COMPONENT_CLASS, [
new CustomInstruction(function (Scaffold $s) {
Function extractCellValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function extractCellValue($fieldName)
{
if (strpos($fieldName, '.') !== false) {
$parts = explode('.', $fieldName);
$res = $this->src;
- 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 apply
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function apply(Scaffold $scaffold)
{
$src = $scaffold->getInput('src');
$scaffold->excludeInput('src');
$class = 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
Method filter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function filter($fieldName, $operator, $value)
{
switch ($operator) {
case "eq":
$operator = '=';
Method filter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function filter($fieldName, $operator, $value)
{
switch ($operator) {
case "eq":
$operator = '=';
Method apply
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function apply(Scaffold $scaffold)
{
$src = $scaffold->getInput('src');
$scaffold->excludeInput('src');
$class = null;
Method apply
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function apply()
{
$input = $this->grid->getInputProcessor()->getInput();
$sort = null;
if (isset($input['sort'])) {
Function filter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function filter($fieldName, $operator, $value)
{
switch ($operator) {
case "eq":
$operator = '=';
- 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 filter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function filter($fieldName, $operator, $value)
{
switch ($operator) {
case "eq":
$operator = '=';
- 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 extractCellValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function extractCellValue($fieldName)
{
if (strpos($fieldName, '.') !== false) {
$parts = explode('.', $fieldName);
- 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 getComponentByNameRecursive
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getComponentByNameRecursive($name)
{
foreach ($this->getComponents() as $component) {
if ($component->getName() === $name) {
return $component;
- 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 listen
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function listen(DataProvider $provider)
{
Event::listen(
DataProvider::EVENT_FETCH_ROW,
function (DataRow $row, DataProvider $currentProvider) use ($provider) {
- 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 provideName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function provideName()
{
$bt_len = 10;
$backtrace = debug_backtrace(null, $bt_len);
$str = '';
- 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 renderCsv
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function renderCsv()
{
$file = fopen('php://output', 'w');
header('Content-Type: text/csv');
- 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"