Showing 94 of 104 total issues
Method applyToRows
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function applyToRows(array $rows)
{
$fieldName = $this->getFieldName();
$condition = $this->getCondition();
$criterion = $this->getCriterion();
Function pagination
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
athens.pagination = (function () {
var getPaginationContainer = function (handle) {
return $("div.pagination-container[data-handle-for=" + handle +"]");
};
- 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 build
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function build()
{
$this->validateInitializer();
$this->validateRenderer();
Function setupSoftPaginationFilter
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setupSoftPaginationFilter = function (handle) {
$(
function () {
var inactiveControls = getInactiveControls(handle);
var activeControls = getActiveControls(handle);
Method queryFilter
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function queryFilter(QueryWrapperInterface $query)
{
$this->canQueryFilter = true;
if ($this->getNextFilter()->canQueryFilter === false) {
$this->canQueryFilter = false;
Function alert
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
athens.alert = (function () {
/**
* Creates an alert div, appends it to the notification area, and schedules it for removal.
*
Method buildTopMatter
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function buildTopMatter()
{
$topMatterBuilder = SectionBuilder::begin()
->setType(SectionBuilder::TYPE_SPAN);
Method __construct
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
$id,
$type,
array $classes,
array $data,
Method queryFilter
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function queryFilter(QueryWrapperInterface $query)
{
$this->canQueryFilter = true;
if ($this->getNextFilter()->canQueryFilter === false) {
$this->canQueryFilter = false;
Function suffixFormFieldsFixed
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function suffixFormFieldsFixed(FormInterface $form, $suffix)
{
foreach ($form->getWritableBearer()->getWritables() as $writable) {
if ($writable instanceof FieldInterface) {
$writable->addSuffix($suffix);
- 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 submitForm
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function submitForm(form, success)
{
athens.alert.makeAlert("Submitting form.", "info");
if (typeof(success) === 'undefined') {
Function select
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
athens.select = (function () {
var getVar = athens.ajax_section.getVar;
var getActiveControls = function (handle) {
return $("#top-filters select[data-handle-for=" + handle + "]");
Method build
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function build()
{
if ($this->type === null) {
throw new \Exception("You must set a page type using ::setType before calling this function.");
}
Method __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$type,
$subject,
$message,
$to,
$from,
Method __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$id,
array $classes,
array $data,
$type,
$method,
Function setupPaginationFilter
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setupPaginationFilter = function (handle) {
// If we have already created this filter, return.
$(
function () {
var page, ajaxSectionName, inactiveControls, activeControls;
Function select_a_section
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
athens.select_a_section = (function () {
var revealSelectASection = function (selectASection, targetSelectionName) {
var selectedOption = selectASection.find("div.option.selectable[data-section-for=" + targetSelectionName + "]");
var selectedSelection = selectASection.find("div.selection[data-selection-name=" + targetSelectionName +"]");
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$id,
$type,
array $classes,
array $data,
$title,
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
array $classes,
array $data,
$type,
$label = "",
$initial = "",
Method validate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function validate()
{
$this->isValid = true;
foreach ($this->getWritableBearer()->getWritables() as $name => $writable) {