Showing 272 of 400 total issues
Function auth
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
public function auth()
{
$result = false;
$isPasswordSet = is_file($this->passwordHashFilepath);
$isPasswordSent = !empty($_POST['password']);
- 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 checkJoomla
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
private function checkJoomla(&$version)
{
$version = CMS_VERSION_UNDEFINED;
$res = 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 onTouchEnd
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FastClick.prototype.onTouchEnd = function(event) {
'use strict';
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
Function Inflater
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Inflater() {
var that = this;
var z = new ZStream();
var bufsize = 512;
var flush = Z_NO_FLUSH;
Function initVML
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initVML() {
/* Utility function to create a VML tag */
function vml(tag, attr) {
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
Function content
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
content: (function () { //TODO: move to separate methods
var dayBEMJSON,
currentDayISO,
currentDateISO,
currentMonthISO,
Function send_tree
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function send_tree(tree,// the tree to be sent
max_code // and its largest code of non zero frequency
) {
var n; // iterates over all tree elements
var prevlen = -1; // last emitted length
Function launchWorkerProcess
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function launchWorkerProcess(worker, reader, writer, offset, size, onappend, onprogress, onend, onreaderror, onwriteerror) {
var chunkIndex = 0, index, outputSize;
function onflush() {
worker.removeEventListener(MESSAGE_EVENT, onmessage, false);
Function inited
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'inited': function () {
if (this.hasMod('type', 'setting')) {
var popup = this.findBlockOutside('page').findBlockInside({block: 'popup', modName: 'name', modVal: 'setting'});
this.bindTo('click', function () {
popup.toggle()
Function setMod
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setMod : function(elem, modName, modVal) {
if(typeof modVal === 'undefined') {
if(typeof elem === 'string') { // if no elem
modVal = typeof modName === 'undefined'?
true : // e.g. setMod('focused')
Function localize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
localize: function() {
$('label.load_file_button')._t('Common.LoadFile');
$('title')._t('Common.Title');
Function _getDatePickerBEMJSON
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getDatePickerBEMJSON: function () {
var clearBEMJSON,
datePickerBEMJSON = [
{
Function _getDatePickerHeadBEMJSON
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getDatePickerHeadBEMJSON: function () {
var datePickerHeadBEMJSON,
titleClickContent = this.months[this._dates.current.month + 1] + ' ' + this._dates.current.year;
// if (!this.changeDisabled) {
Function addPointerEvent
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addPointerEvent(type, toExtend) {
var eventName = 'pointer' + type,
pointerevent,
Function build_tree
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
that.build_tree = function(s) {
var tree = that.dyn_tree;
var stree = that.stat_desc.static_tree;
var elems = that.stat_desc.elems;
var n, m; // iterate over heap elements
Function un
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
un : function(e, fn, ctx) {
if(typeof e === 'string' || typeof e === 'undefined') {
var storage = this[storageExpando];
if(storage) {
if(e) { // if event type was passed
Method __construct
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($rootPath = '.')
{
$this->rootPath = $rootPath;
$this->versions = array();
$this->types = array();
Function getData
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Entry.prototype.getData = function(writer, onend, onprogress, checkCrc32) {
var that = this, worker;
function terminate(callback, param) {
if (worker)
Function addFileEntry
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addFileEntry(zipEntry, fileEntry, onend, onerror) {
function getChildren(fileEntry, callback) {
if (fileEntry.isDirectory)
fileEntry.createReader().readEntries(callback);
if (fileEntry.isFile)
Consider simplifying this complex logical expression. Open
Open
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || _method != Z_DEFLATED || bits < 9 || bits > 15 || _level < 0 || _level > 9 || _strategy < 0
|| _strategy > Z_HUFFMAN_ONLY) {
return Z_STREAM_ERROR;
}