Showing 71 of 115 total issues
File d3photo-view.js
has 2087 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.photoviewer = factory());
}(this, (function () { 'use strict';
Function PhotoViewer
has 606 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PhotoViewer = /*#__PURE__*/function () {
function PhotoViewer(items, options, el) {
_classCallCheck(this, PhotoViewer);
this.options = $.extend(true, {}, DEFAULTS, options);
Function resizable
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
resizable: function resizable(modal, stage, image, minWidth, minHeight) {
var _this = this;
var resizableHandleE = $("<div class=\"".concat(NS, "-resizable-handle ").concat(NS, "-resizable-handle-e\"></div>"));
var resizableHandleW = $("<div class=\"".concat(NS, "-resizable-handle ").concat(NS, "-resizable-handle-w\"></div>"));
File d3files-preview.js
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jslint browser */
/*globals D3PDF, console, jQuery, D3FilesPreviewJsVars*/
/*global D3PDF, console, jQuery, D3FilesPreviewJsVars*/
/*jshint esversion: 6 */
/**
Method run
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(int $id): array
{
try {
$postModelName = Yii::$app->request->post('model_name');
Function run
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function run(int $id): array
{
try {
$postModelName = Yii::$app->request->post('model_name');
- 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 init
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function init(): void
{
parent::init();
// Backward compatibility
- 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 actionUnusedFiles
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function actionUnusedFiles(string $modelName): int
{
$modelMN = new D3filesModelName();
if (!$modelNameId = $modelMN->getByName($modelName, 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 init
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function init(): void
{
if (!$this->options) {
$this->options = ['multiple' => true];
}
- 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 run
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function run(int $id, string $model_name_id = ''): void
{
if (!$model_name_id){
if (empty($this->modelName)) {
- 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 movable
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
movable: function movable(stage, image) {
var _this = this;
var isDragging = false;
var startX = 0;
File D3files.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace d3yii2\d3files\models;
use d3system\exceptions\D3ActiveRecordException;
Method init
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init(): void
{
parent::init();
// Backward compatibility
Method run
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(int $id, string $model_name_id = ''): void
{
if (!$model_name_id){
if (empty($this->modelName)) {
Function _keydown
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function _keydown(e) {
if (!this.options.keyboard) {
return false;
}
Function uploadFile
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function uploadFile(file, widget) {
"use strict";
let form;
let fileInputName;
let tbl;
Function zoomTo
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function zoomTo(ratio, origin, e) {
var $image = this.$image;
var $stage = this.$stage;
var imgData = {
w: this.imageData.width,
Method fileListForWidget
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fileListForWidget(
string $modelName,
int $modelId,
bool $forPath = false
): array
Method init
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init(): void
{
if (!$this->options) {
$this->options = ['multiple' => true];
}
Function anim
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
var anim = function (properties, duration, ease, callback, delay) {
var key, cssValues = {}, cssProperties, transforms = '',
that = this, wrappedCallback, endEvent = D.fx.transitionEnd,
fired = false;