oss-specs/specs

View on GitHub

Showing 192 of 192 total issues

Function getNameAndPath has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function getNameAndPath (projectData) {
  var repoName;
  var localPath;

  if (!projectData.localPathRoot) {
Severity: Minor
Found in lib/specifications/repository-types/git/name-and-path.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

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

      selectEl.on('change', function() {
        window.location.href = window.location.pathname + '?view=' + this.value;
      });
Severity: Minor
Found in public/javascript/project.js and 1 other location - About 50 mins to fix
public/javascript/project.js on lines 85..87

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 51.

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

    selectEl.on('change', function() {
      window.location.href = window.location.pathname + '?branch=' + this.value;
    });
Severity: Minor
Found in public/javascript/project.js and 1 other location - About 50 mins to fix
public/javascript/project.js on lines 99..101

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 51.

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

Avoid deeply nested control flow statements.
Open

          for (var iBody = 0; iBody < scenario.examples[j].tableBody.length; iBody++) {
            for (var iHeader = 0; iHeader < scenario.examples[j].tableHeader.cells.length; iHeader++) {
              var re = new RegExp('<' + scenario.examples[j].tableHeader.cells[iHeader].value + '>', 'g');
              updatedName = updatedName.replace(re, scenario.examples[j].tableBody[iBody].cells[iHeader].value);
            }
Severity: Major
Found in views/helpers/index.js - About 45 mins to fix

Function filterFeaturesAndScenarios has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function filterFeaturesAndScenarios(projectData, projectTags, currentTagName) {

  // Count the project tags and mark the current
  // tag of interest if there is one.
  let ret = countProjectTags(projectData, projectTags, currentTagName);
Severity: Minor
Found in lib/specifications/files/feature-files/tags.js - About 45 mins 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 generateRepoMetaData has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function generateRepoMetaData(projectData, sha, tagsAndBranches, currentBranchName, files, remoteUrl) {
Severity: Minor
Found in lib/specifications/repository-types/git/project-data.js - About 45 mins to fix

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

      return scenario.steps
      .filter(function(step) {
        return step.argument && step.argument.type === 'DataTable';
      })
      .map(function(step) {
Severity: Minor
Found in features-support/step_definitions/parsing.js and 1 other location - About 35 mins to fix
features-support/step_definitions/parsing.js on lines 208..214

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 47.

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

        return scenario.steps
          .filter(function(step) {
            return step.argument && step.argument.type === 'DocString';
          })
          .map(function(step) {
Severity: Minor
Found in features-support/step_definitions/parsing.js and 1 other location - About 35 mins to fix
features-support/step_definitions/parsing.js on lines 183..194

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 47.

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 getCustomCapabilitiesFromEnvironment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getCustomCapabilitiesFromEnvironment(webdriver) {
  var saucelabsProperties = {};

  var browserKey = webdriver.Capability.BROWSER_NAME;
  var platformKey = webdriver.Capability.PLATFORM_NAME;
Severity: Minor
Found in features-support/hooks/ui-automation.js - About 35 mins 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function() {
  // Default asynchronous step timeout to 10 seconds
  this.setDefaultTimeout(10 * 1000);

  this.World = function World() {
Severity: Minor
Found in features-support/world.js - About 25 mins 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 getFilePathToFileObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function getFilePathToFileObject(projectRoute, projectData, getFileContent) {

  /**
   * Given a file path return an object represenating that file
   * potentially including a promise for the file contents.
Severity: Minor
Found in lib/specifications/files/process-files.js - About 25 mins 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 processFileContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function processFileContent(file) {
  var fileContent = file.content;

  if (!fileContent || !fileContent.length) {
    file.empty = true;
Severity: Minor
Found in lib/specifications/files/process-files.js - About 25 mins 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

Rule doesn't have all its properties in alphabetical order.
Open

    .alphabeta::after {
Severity: Minor
Found in public/css/alphabeta.css by csslint

Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.
Open

  text-indent: -9999px;
Severity: Minor
Found in public/css/burger.css by csslint

Adjoining classes: .burger-menu.open span::after
Open

.burger-menu.open span::after {
Severity: Minor
Found in public/css/burger.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.scenario hr {
Severity: Minor
Found in public/css/feature.css by csslint

Heading (h1) has already been defined.
Open

main > h1,
Severity: Minor
Found in public/css/main.css by csslint

The box-sizing property isn't supported in IE6 and IE7.
Open

  box-sizing: border-box;
Severity: Minor
Found in public/css/main.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

  main > header {
Severity: Minor
Found in public/css/main.css by csslint

Element (form.theForm) is overqualified, just use .theForm without element name.
Open

 form.theForm {
Severity: Minor
Found in public/css/main.css by csslint
Severity
Category
Status
Source
Language