Trioxis/aws-backup-manager

View on GitHub

Showing 8 of 8 total issues

Function default has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function () {
    let collector = {
        stats: {
            ec2Objects: {
                snapshots: 0,
Severity: Major
Found in src/index.js - About 3 hrs to fix

    Function listEBS has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        listEBS () {
            let warnings = [];
            return new Promise( (resolve, reject) => {
    
                let ec2 = new AWS.EC2();
    Severity: Major
    Found in src/EC2Store.js - About 2 hrs to fix

      Function listSnapshots has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          listSnapshots () {
              let warnings = [];
      
              return new Promise((resolve, reject) => {
                  let ec2 = new AWS.EC2();
      Severity: Major
      Found in src/EC2Store.js - About 2 hrs to fix

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

        var printSnaplist = (snapshots, verbose) => {
            if (verbose /* implement verbose flag later */) {
                log('AWSBM Backups');
                log(headingLine);
                if (snapshots.length === 0) {
        Severity: Minor
        Found in src/printing.js - About 1 hr to fix

          Function printSnaplist has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          var printSnaplist = (snapshots, verbose) => {
              if (verbose /* implement verbose flag later */) {
                  log('AWSBM Backups');
                  log(headingLine);
                  if (snapshots.length === 0) {
          Severity: Minor
          Found in src/printing.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 _tagSnapshot has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          let _tagSnapshot = (snapshot, action) => {
              let ec2 = new AWS.EC2();
              let madeDate = moment(snapshot.StartTime, 'ddd MMM DD YYYY HH:mm:ss ZZ');
              let tags = [{
                  Key: 'backups:config-v0',
          Severity: Minor
          Found in src/Actioner/SnapshotVolumeAction.js - About 1 hr to fix

            Function printEBSList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var printEBSList = (volumes) => {
                log('AWSBM Volumes');
                log(headingLine);
                if (volumes.length === 0) {
                    log('No volumes with valid backups:config-v0 tag found');
            Severity: Minor
            Found in src/printing.js - About 1 hr to fix

              Function checkAndCreateLogStream has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              let checkAndCreateLogStream = (group, stream) => {
                  var cloudwatchlogs = new AWS.CloudWatchLogs();
              
                  return new Promise((resolve, reject) => {
                      cloudwatchlogs.describeLogStreams({
              Severity: Minor
              Found in src/CloudWatchLogger.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language