Showing 21 of 212 total issues
File collection-test.ts
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { collection, create, hasClass, text } from 'ember-cli-page-object';
import withIteratorSymbolDefined from '../../../helpers/with-iterator-symbol-defined';
import { setupRenderingTest, TestContext } from '../../../helpers';
import { module, test } from 'qunit';
File value-test.ts
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { create, value } from 'ember-cli-page-object';
import { setupRenderingTest, TestContext } from '../../../helpers';
import { module, test } from 'qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
Function exports
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function () {
return {
usePnpm: true,
scenarios: [
{
File action-test.js
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { module, test } from 'qunit';
import { create } from 'ember-cli-page-object';
import action from 'ember-cli-page-object/-private/action';
import { isPageObject } from 'ember-cli-page-object/-private/meta';
import { setAdapter, getAdapter } from 'ember-cli-page-object/adapters';
File actions-test.ts
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
import 'qunit-dom';
import { run } from '@ember/runloop';
import { module, test } from 'qunit';
import { render } from '@ember/test-helpers';
File composition-test.ts
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { setupRenderingTest } from '../../helpers';
import { test, module } from 'qunit';
import {
isPageObject,
getPageObjectDefinition,
Function buildObject
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildObject(node, blueprintKey, blueprint, defaultBuilder) {
let definition;
// Preserve plain arrays, prevent `Error: string values are not supported in page object definitions Key: "0"` error
if (Array.isArray(blueprint)) {
Function keyPress
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
keyPress(key, asyncOp) {
let exec = () => {
let result = this.expression;
let stack = this.stack;
let op = this.op;
Function writeDocsFile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function writeDocsFile(srcPath, destDir, options) {
// capture stdout of 'documentation'
// FIXME: Change this to use documentation Node API
var filename = options.slug + '.md';
var destPath = path.join(destDir, filename);
Function massageMarkdown
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function massageMarkdown(markdown, options) {
var headerRegex = /^#{1,6} /;
var h2Regex = /^## (.*)$/;
var lines = markdown.split('\n');
var tableOfContents = ['### Methods\n'];
Function create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function create(definition = {}, options = {}) {
if (typeof definition === 'string') {
throw new Error('Definition can not be a string');
}
Function proxyIfSupported
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function proxyIfSupported(instance) {
if (window.Proxy) {
return new window.Proxy(instance, {
get: function (target, name) {
if (typeof name === 'number' || typeof name === 'string') {
- 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 attr
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function attr(element, attributeName) {
const value = element.getAttribute(attributeName);
if (value) {
// Non-existent attributes return `null`, we normalize to undefined
return value == null ? undefined : value;
- 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 getter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function getter(fn) {
if (typeof fn !== 'function') {
throw new Error('Argument passed to `getter` must be a 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 exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (environment) {
let ENV = {
modulePrefix: 'test-app',
environment,
rootURL: '/',
Function getter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getter(fn) {
if (typeof fn !== 'function') {
throw new Error('Argument passed to `getter` must be a function.');
}
Function getProperty
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getProperty(object, pathToProp) {
const pathSegments = pathToProp.split('.');
let parent = object;
let value;
- 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 addValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function addValue(
urlSearchParams,
key,
value,
parentKey = '',
- 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 writeDocsFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function writeDocsFile(srcPath, destDir, options) {
// capture stdout of 'documentation'
// FIXME: Change this to use documentation Node API
var filename = options.slug + '.md';
var destPath = path.join(destDir, filename);
- 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 addValue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
urlSearchParams,
key,
value,
parentKey = '',
isArrayValue = false