san650/ember-cli-page-object

View on GitHub

Showing 212 of 212 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  test('throws error if more than 1 element found', async function (assert) {
    const page = create({});

    await render(
      hbs`<em class="lorem"></em><em class="lorem"></em><span class="ipsum"></span>`
Severity: Major
Found in test-app/tests/unit/extend/find-one-test.ts and 2 other locations - About 1 hr to fix
test-app/tests/unit/extend/find-element-with-assert-test.ts on lines 46..57
test-app/tests/unit/extend/find-element-with-assert-test.ts on lines 59..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 66.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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;
Severity: Minor
Found in test-app/app/controllers/calculator.js - About 1 hr to fix

    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);
    Severity: Minor
    Found in docs/index.js - About 1 hr to fix

      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'];
      Severity: Minor
      Found in docs/index.js - About 1 hr to fix

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

              {
                name: 'ember-release',
                npm: {
                  devDependencies: {
                    '@ember/string': '^3.1.1',
        Severity: Major
        Found in test-app/config/ember-try.js and 2 other locations - About 1 hr to fix
        test-app/config/ember-try.js on lines 58..71
        test-app/config/ember-try.js on lines 72..85

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

              {
                name: 'ember-canary',
                npm: {
                  devDependencies: {
                    '@ember/string': '^3.1.1',
        Severity: Major
        Found in test-app/config/ember-try.js and 2 other locations - About 1 hr to fix
        test-app/config/ember-try.js on lines 26..39
        test-app/config/ember-try.js on lines 58..71

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

              {
                name: 'ember-beta',
                npm: {
                  devDependencies: {
                    '@ember/string': '^3.1.1',
        Severity: Major
        Found in test-app/config/ember-try.js and 2 other locations - About 1 hr to fix
        test-app/config/ember-try.js on lines 26..39
        test-app/config/ember-try.js on lines 72..85

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            const page = create({
              foo: {
                bar: {
                  baz: focusable('span'),
                  qux: focusable('input'),
        Severity: Major
        Found in test-app/tests/unit/-private/properties/focusable-test.ts and 1 other location - About 1 hr to fix
        test-app/tests/unit/-private/properties/blurrable-test.ts on lines 207..216

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            const page = create({
              foo: {
                bar: {
                  baz: blurrable('span'),
                  qux: blurrable('input'),
        Severity: Major
        Found in test-app/tests/unit/-private/properties/blurrable-test.ts and 1 other location - About 1 hr to fix
        test-app/tests/unit/-private/properties/focusable-test.ts on lines 211..220

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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');
          }
        
        
        Severity: Minor
        Found in addon/src/create.js - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            export function selectable(scope?: string, userOptions?: FindOptions): MethodDescriptor<<T>(this: T, clueOrContent: string, content?: string) => T>;
          Severity: Major
          Found in addon/types.d.ts and 1 other location - About 1 hr to fix
          addon/types.d.ts on lines 32..32

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            export function fillable(scope?: string, userOptions?: FindOptions): MethodDescriptor<<T>(this: T, clueOrContent: string, content?: string) => T>;
          Severity: Major
          Found in addon/types.d.ts and 1 other location - About 1 hr to fix
          addon/types.d.ts on lines 33..33

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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') {
          Severity: Minor
          Found in addon/src/properties/collection.js - About 1 hr to fix

          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.');
            }
          
          
          Severity: Minor
          Found in addon/src/macros/getter.js - About 1 hr to fix

          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;
          Severity: Minor
          Found in addon/src/properties/attribute.js - About 1 hr to fix

          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: '/',
          Severity: Minor
          Found in test-app/config/environment.js - About 1 hr to fix

            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.');
              }
            
            
            Severity: Minor
            Found in addon/src/macros/getter.js - About 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      child: {
                        scope: '.child',
              
                        run: action({ selector: '.Selector2' }, function () {
                          return next().then(() => {
              Severity: Minor
              Found in test-app/tests/unit/-private/action-test.js and 1 other location - About 55 mins to fix
              test-app/tests/unit/-private/action-test.js on lines 164..172

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 54.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  const p = create({
                    scope: '.Scope',
              
                    run: action({ selector: '.Selector' }, function () {
                      return next().then(() => {
              Severity: Minor
              Found in test-app/tests/unit/-private/action-test.js and 1 other location - About 55 mins to fix
              test-app/tests/unit/-private/action-test.js on lines 351..359

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 54.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              export function blurrable(selector = '', userOptions = {}) {
                return action(
                  {
                    ...userOptions,
                    selector,
              Severity: Minor
              Found in addon/src/properties/blurrable.js and 1 other location - About 55 mins to fix
              addon/src/properties/clickable.js on lines 66..72

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 53.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language