Showing 82 of 90 total issues
Function actionClone
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function actionClone($vendor = null, $repo = null)
{
// if `vendor/repo` notation is provided
if ($vendor !== null && strpos($vendor, '/')) {
list($vendor, $repo) = explode("/", $vendor);
- 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 actionCreate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionCreate(string $themeName = null)
{
Console::clearScreenBeforeCursor();
$themeName = $this->prompt("Enter the name (lower case) of the theme you like to generate:", ['default' => $themeName]);
Function _computeTargetAndRootIntersection
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function(target, targetRect, rootRect) {
// If the element isn't displayed, an intersection can't happen.
if (window.getComputedStyle(target).display == 'none') return;
var intersectionRect = targetRect;
Function trigger
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected static function trigger($name)
{
if (isset(static::$_hooks[$name])) {
$events = [];
- 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 play
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
play() {
if (this.isPaused) {
return this.resume()
}
Function _monitorIntersections
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
IntersectionObserver.prototype._monitorIntersections = function(doc) {
var win = doc.defaultView;
if (!win) {
// Already destroyed.
return;
Function loadImage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadImage(image) {
const context = this
this.log('Image loading:', { id: image.id, image })
Function beforeRun
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function beforeRun($app)
{
foreach ($app->tags as $name => $config) {
TagParser::inject($name, $config);
}
- 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 buildTraceItem
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildTraceItem(array $item)
{
$file = $item['file'] ?? null;
$line = $item['line'] ?? null;
$contextLine = null;
Function getOwnPropertyDescriptor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if (isPrimitive(object)) {
throw new TypeError(ERR_NON_OBJECT + object);
}
Method getInternalResolverArray
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getInternalResolverArray()
{
if ($this->_resolved === null) {
$requestPathInfo = $this->trailingPathInfo();
$newRegex = $this->buildRegexPattern();
Function generateClassName
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function generateClassName($tableName, $useSchemaName = null)
{
if (isset($this->classNames[$tableName])) {
return $this->classNames[$tableName];
}
- 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 actionCreate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionCreate()
{
Console::clearScreenBeforeCursor();
$moduleName = $this->prompt("Enter the name of the module you like to generate:");
Method actionIndex
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex()
{
// opcache reset should run in web context, but might be helpfull as well.
if (function_exists('opcache_reset')) {
@opcache_reset();
Method run
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
TextToSpeechAsset::register($this->view);
$config = Json::htmlEncode([
Function defineProperty
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Object.defineProperty = function defineProperty(object, property, descriptor) {
if (isPrimitive(object)) {
throw new TypeError(ERR_NON_OBJECT_TARGET + object);
}
if (isPrimitive(descriptor)) {
Method actionClone
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionClone($vendor = null, $repo = null)
{
// if `vendor/repo` notation is provided
if ($vendor !== null && strpos($vendor, '/')) {
list($vendor, $repo) = explode("/", $vendor);
Function actionCreate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreate(string $themeName = null)
{
Console::clearScreenBeforeCursor();
$themeName = $this->prompt("Enter the name (lower case) of the theme you like to generate:", ['default' => $themeName]);
- 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 getViewPath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getViewPath()
{
if ($this->module instanceof Module) {
if ($this->module->useAppViewPath) {
return '@app/views/' . $this->module->id . '/' . $this->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
Function _checkForIntersections
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
IntersectionObserver.prototype._checkForIntersections = function() {
if (!this.root && crossOriginUpdater && !crossOriginRect) {
// Cross origin monitoring, but no initial data available yet.
return;
}