beevelop/corci-ios

View on GitHub

Showing 7 of 7 total issues

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

IOS.prototype.generateUnsignedIpa = function () {
    /* 1.) create Payload directory */
    fs.mkdirs(this.payloadDir, function (err) {
        if (err) {
            this.agent.log(this.build, Msg.error, 'Can\'t create Payload directory at {2}:\n{3}', this.buildDir, err);
Severity: Minor
Found in lib/IOS.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 generateUnsignedIpa has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

IOS.prototype.generateUnsignedIpa = function () {
    /* 1.) create Payload directory */
    fs.mkdirs(this.payloadDir, function (err) {
        if (err) {
            this.agent.log(this.build, Msg.error, 'Can\'t create Payload directory at {2}:\n{3}', this.buildDir, err);
Severity: Minor
Found in lib/IOS.js - About 1 hr to fix

    Function generateSignedIpa has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    IOS.prototype.generateSignedIpa = function () {
        this.agent.log(this.build, Msg.info, 'Creating a new signed ipa!');
    
        if (!this.build.conf.iosprovisioningpath) {
            return this.buildFailed('-iosprovisioningpath:"path-to-your-provision-file.mobileprovision" was not being specified!');
    Severity: Minor
    Found in lib/IOS.js - About 1 hr to fix

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

      IOS.prototype.buildDone = function (err) {
          if (this.build.conf.status === 'cancelled') {
              return;
          }
          if (err) {
      Severity: Minor
      Found in lib/IOS.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                            if (stderr && (err && err.message || err && err.indexOf && err || '').indexOf(stderr) < 0) {
                                this.agent.log(this.build, Msg.error, 'stderror:\n{2}', stderr);
                            }
        Severity: Major
        Found in lib/IOS.js - About 1 hr to fix

          Function filesDone has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          IOS.prototype.filesDone = function (startBuild) {
              this.agent.callback = startBuild;
              if (this.build.conf.status === 'cancelled') {
                  return;
              }
          Severity: Minor
          Found in lib/IOS.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 preCordovaBuild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          IOS.prototype.preCordovaBuild = function (build, cmd, buildCordova) {
              cmd += ' | tee "' + path.resolve(this.locationPath, 'build.ios.xcodebuild.log') + '" | egrep -A 5 -i "(error|warning|succeeded|fail|codesign|running|return)"';
          
              if (build.conf.iosskipsign) {
                  buildCordova(
          Severity: Minor
          Found in lib/IOS.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

          Severity
          Category
          Status
          Source
          Language