Showing 107 of 233 total issues
Function MediaBrowser
has 297 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MediaBrowser(browser, options) {
this.document = $(document);
this.browser = $(browser);
this.upload = this.browser.find('.media-upload');
this.dropzone = this.upload.find('.dropzone');
File MediaUploadHandler.php
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @link http://www.writesdown.com/
* @copyright Copyright (c) 2015 WritesDown
* @license http://www.writesdown.com/license/
File menu.js
has 469 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
* Dual-licensed under the BSD or MIT licenses
*/
(function($, window, document, undefined)
Function actionIndex
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function actionIndex()
{
/* @var $postType PostType */
/* @var $post Post */
/* @var $taxonomies Taxonomy[] */
- 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 dragMove
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
dragMove: function(e)
{
var list, parent, prev, next, depth,
opt = this.options,
mouse = this.mouse;
MediaUploadHandler
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class MediaUploadHandler
{
const PRINT_RESPONSE = true;
const NOT_PRINT_RESPONSE = false;
Function actionCreate
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreate()
{
$errors = [];
$model = new Module(['scenario' => 'create']);
- 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 actionIndex
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex()
{
/* @var $postType PostType */
/* @var $post Post */
/* @var $taxonomies Taxonomy[] */
Function actionBulkAction
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function actionBulkAction()
{
if (Yii::$app->request->post('action') === Post::STATUS_PUBLISH) {
foreach (Yii::$app->request->post('ids', []) as $id) {
$model = $this->findModel($id);
- 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
File media.browser.js
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function ($) {
'use strict';
function MediaBrowser(browser, options) {
this.document = $(document);
Function actionCreate
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreate($type)
{
$model = new Post();
$postType = $this->findPostType($type);
$model->comment_status = Option::get('default_comment_status');
- 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 actionCreateMenuItem
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreateMenuItem($id)
{
$items = '';
if (Yii::$app->request->post('type') === 'link') {
- 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 actionCreate
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreate()
{
$errors = [];
$model = new Widget(['scenario' => 'upload']);
- 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 actionUpload
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function actionUpload()
{
$errors = [];
$model = new DynamicModel(['file']);
$model->addRule(['file'], 'required')
- 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 actionView
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionView($type, $slug, $page = 1)
{
/* @var $taxonomy Taxonomy */
/* @var $postType PostType */
/* @var $posts Post[] */
Method actionCreate
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionCreate()
{
$errors = [];
$model = new Module(['scenario' => 'create']);
Function beforeSave
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
if ($this->isNewRecord) {
if (!Yii::$app->user->isGuest) {
- 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 actionView
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function actionView($type, $slug, $page = 1)
{
/* @var $taxonomy Taxonomy */
/* @var $postType PostType */
/* @var $posts Post[] */
- 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 renderToolbar
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderToolbar($event)
{
/* @var $view View */
/* @var $urlBack \yii\web\UrlManager */
Method up
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';