oss-specs/specs

View on GitHub

Showing 26 of 192 total issues

Function exports has 181 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function () {

  this.Given(/^a URL representing a remote Git repo "([^"]*)"$/, function (repoUrl) {
    this.repoUrl = repoUrl;
  });
Severity: Major
Found in features-support/step_definitions/features.js - About 7 hrs to fix

Function exports has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function() {
  // Shared variables
  var featureText;
  var features;

Severity: Major
Found in features-support/step_definitions/parsing.js - About 5 hrs to fix

Function checkResultsFromList has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function checkResultsFromList(array, scenario) {
  if (array && array.length > 0) {
    var passes ='';
    var scenarioName= scenario.name;
    if(scenario.type === 'ScenarioOutline' ) {
Severity: Minor
Found in views/helpers/index.js - About 3 hrs 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 _processViews has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function _processViews(projectViews) {
  var viewNames;

  // Valid undefined argument.
  if (projectViews === undefined) {
Severity: Major
Found in lib/configuration/project-config.js - About 2 hrs to fix

Function switchToDemoBranch has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function switchToDemoBranch(callback) {
    var world = this;
    var burgerMenuId = 'expand-collapse-repository-controls';
    var repositoryCongtrolsId = 'repository-controls';
    var projectShaElId = 'project-commit';
Severity: Minor
Found in features-support/step_definitions/features.js - About 2 hrs to fix

Function exports has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function() {
  // Shared variables
  var featureText;
  var features;

Severity: Minor
Found in features-support/step_definitions/parsing.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 compareJobsAndFeatures has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function compareJobsAndFeatures(array, scenarioName,directFeature) {
  if (array && array.length > 0) {
    var passes ='';
    for( var i = 0; i < array.length ; i++) {
      //If we check direct equals then we miss out some in scenario outline that end in digits, so needs changing
Severity: Minor
Found in views/helpers/index.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 getRender has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getRender(res, appConfig, renderOptions) {
  return function render(projectData) {
    var renderingData = {};

    // The tags object associated with this project.
Severity: Minor
Found in routes/project.js - About 1 hr to fix

Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return function render(projectData) {
    var renderingData = {};

    // The tags object associated with this project.
    var projectTags = {};
Severity: Minor
Found in routes/project.js - About 1 hr to fix

Function getRender has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function getRender(res, appConfig, renderOptions) {
  return function render(projectData) {
    var renderingData = {};

    // The tags object associated with this project.
Severity: Minor
Found in routes/project.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 seleniumHooks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function seleniumHooks() {
  // Lets give browser a minute to start up
  this.Before({ tags: ['@ui-automation'], timeout: 60 * 1000}, function(scenario, callback) {
    var world = this;
    var timeoutManager;
Severity: Minor
Found in features-support/hooks/ui-automation.js - About 1 hr to fix

Function applyProjectView has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function applyProjectView(projectData, renderingData) {
  var currentProjectViewName = renderingData.currentProjectViewName;
  var projectView = {};
  var viewNames = [];

Severity: Minor
Found in lib/specifications/projects/project-views.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 expandCollapseDetails has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function expandCollapseDetails() {
      var featureTitleEl = window.document.getElementById('feature-title');
      var tagsButtonEl = window.document.getElementById('expand-collapse-tags');
      var featureDetailsEls = window.document.getElementsByClassName('feature-details');
      var scenarioDetailsEls = window.document.getElementsByClassName('scenario-details');
Severity: Minor
Found in public/javascript/feature.js - About 1 hr to fix

Function applyProjectView has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function applyProjectView(projectData, renderingData) {
  var currentProjectViewName = renderingData.currentProjectViewName;
  var projectView = {};
  var viewNames = [];

Severity: Minor
Found in lib/specifications/projects/project-views.js - About 1 hr to fix

Function filterFeaturesAndScenarios has 33 lines of code (exceeds 25 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 1 hr to fix

Function getProjectData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getProjectData(projectData, targetBranchName) {
  var currentRef;
  var repository;
  var remoteUrl;
  var headCommit;
Severity: Minor
Found in lib/specifications/repository-types/git/project-data.js - About 1 hr to fix

Function update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function update(projectData) {

  var repository;
  var defaultBranch;
  var defaultRemoteBranch;
Severity: Minor
Found in lib/specifications/repository-types/git/fetching.js - About 1 hr to fix

Function getCustomCapabilitiesFromEnvironment has 30 lines of code (exceeds 25 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 1 hr to fix

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

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

Severity
Category
Status
Source
Language