Showing 251 of 1,173 total issues
Function show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
Method testRemoveURLProtocol
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRemoveURLProtocol()
{
$utility = new StringUtility();
$inputOutputs = [
Method bindCriteria
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function bindCriteria(\PDOStatement $statement, array $criteria)
{
// bind criteria values
if (!empty($criteria)) {
$counter = 0;
Method getOneById
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOneById($id, $excludeArchived = true)
{
$output = new Output();
/*
* start validating
Method validatePassword
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validatePassword(array $args)
{
$output = new Output();
if (empty($args['toBeCheckedInput'])) {
$output->setSuccess(false);
Method send
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send($to, $subject, $message)
{
if (empty($to)) {
throw new \Exception('Recipient for sending email cannot be empty');
}
Method make
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function make(Page $page, array $templates, $masterTemplate = null, $formHandler = null)
{
// set master template
if ($masterTemplate === null) {
$this->getMaster()->setTemplateName($this->getConfig()->get('defaultMasterTemplate'));
Function checkPosition
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var height = this.$element.height()
var offset = this.options.offset
Method login
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function login($key, $value, $password)
{
// determine which mapper should be called
$mapperName = $this->getMapperName();
Method generateRadioButtons
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateRadioButtons($options, $name = null, $checked = null, array $configs = [])
{
$html = '';
$type = 'radio';
Function batchInsertQuery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function batchInsertQuery(array $fieldsValuesCollection)
{
if (empty($fieldsValuesCollection)) {
throw new \Exception('fieldsValues cannot be empty in insertQuery function');
}
- 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 route
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function route()
{
// get request method and URI
$request = new Request();
$requestMethod = $request->getRequestMethod();
- 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 addStyleFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function addStyleFile($filePath, $orderNumber = null)
{
if ($orderNumber !== null) {
// validate order number
if (!is_numeric($orderNumber) || $orderNumber < 0) {
- 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 logMessage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function logMessage($level, $message, $context = [])
{
if ($this->getConfigs()['inOperation'] !== true) {
return false;
}
- 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 addScriptFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function addScriptFile($filePath, $orderNumber = null)
{
if ($orderNumber !== null) {
// validate order number
if (!is_numeric($orderNumber) || $orderNumber < 0) {
- 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 testGetExcludeArchivedCriteria
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetExcludeArchivedCriteria()
{
$app = App::getInstance();
$app->init('dev');
Method testGetClassNameFromNamespace
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetClassNameFromNamespace()
{
$utility = new StringUtility();
$inputOutputs = [
Method forgotPassword
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function forgotPassword($email)
{
/**
* Start validating email.
*/
Method resetPassword
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resetPassword($email, $resetPasswordToken, $password, $passwordConfirmation)
{
/**
* Start validating email & token.
*/
Method validateWhitelist
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validateWhitelist(array $args)
{
$output = new Output();
if (!isset($args['whitelist']) || !is_array($args['whitelist'])) {